-
How does Key Shared mode ensure the order of consume when consumer unack and broker send msg to onsumer occur concurrent? such as : time → Consumer msgs: (1,2,3) Will consumer consume the msg 4 before msg 1? |
Beta Was this translation helpful? Give feedback.
Answered by
merlimat
Jan 11, 2024
Replies: 1 comment 5 replies
-
If order matters, I don't think you should negatively acknowledge a message in the Key-Shared subscription. |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you do negative-ack, you are requesting a message to be redelivered later. In the meantime, you will receive other messages, potentially for the same key, therefore you will get out-of-order.
If you want to ensure strict ordering, you need to pause and hold on to the message and keep trying to process the same message until you succeed, before resuming to the rest of messages.