caibirdme opened a new issue #431:
URL: https://github.com/apache/pulsar-client-go/issues/431


   when subscribe a topic, say "foo",  the topic field in the returned 
pulsar.Message is `foo-partition-N`.
   
   Why we do this, or is this what pulsar broker returns to the client? I mean, 
it'd be better if we keep the topic as it actually is, and add a field called 
Partition in the Message to indicate which partition the message belongs to, 
something like:
   ```
   msg.Topic == "foo"
   msg.Partition == N
   ```
   rather than:
   ```
   msg.Topic == "foo-partition-N"
   ```
   
   By doing this, we can easily switch case the topic and call some releated 
function, like:
   ```
   switch msg.Topic {
     case "foo":
       invokeFoo(msg)
     case "bar":
       invokeBar(msg)
     //...
     default:
       invokeDefault(msg)
   }
   ``` 


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to