BewareMyPower commented on issue #6945:
URL: https://github.com/apache/pulsar/issues/6945#issuecomment-634739076


   You could create multiple producers and deliver the message to the right 
producer associated with the key.
   
   **However, I suspected that it's broker's problem.** Here is my experiment:
   
   First, I created 2 producers and 2 consumers. The producers' batching max 
publish delay ms are both 3000, which is large enough for batching. Then I used 
one producer to send messages with key "A", and another producer to send 
messages with key "B". Only one consumer could receive the messages:
   
   ```
   topic: persistent://public/default/FooTest | payload: 0 | key: A | id: 
(3084,40,-1,0)
   topic: persistent://public/default/FooTest | payload: 2 | key: A | id: 
(3084,40,-1,1)
   topic: persistent://public/default/FooTest | payload: 4 | key: A | id: 
(3084,40,-1,2)
   topic: persistent://public/default/FooTest | payload: 6 | key: A | id: 
(3084,40,-1,3)
   topic: persistent://public/default/FooTest | payload: 8 | key: A | id: 
(3084,40,-1,4)
   topic: persistent://public/default/FooTest | payload: 1 | key: B | id: 
(3084,41,-1,0)
   topic: persistent://public/default/FooTest | payload: 3 | key: B | id: 
(3084,41,-1,1)
   topic: persistent://public/default/FooTest | payload: 5 | key: B | id: 
(3084,41,-1,2)
   topic: persistent://public/default/FooTest | payload: 7 | key: B | id: 
(3084,41,-1,3)
   topic: persistent://public/default/FooTest | payload: 9 | key: B | id: 
(3084,41,-1,4)
   ```
   
   From the 4th field of message id, which is the batch index, you can see 10 
messages of 2 keys were sent by 2 batched messages. But if I disabled batching 
and sent the messages again, one consumer received messages with key "A", 
another consumer received messages with key "B".


----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to