michaeljmarshall commented on issue #9916:
URL: https://github.com/apache/pulsar/issues/9916#issuecomment-804609809


   After looking at this a little more, I am wondering if it is inexpensive 
enough to use a transaction to produce to the DLQ topic and acknowledge the 
original message atomically. Then, the messages would not be end up available 
on both the source topic and the DLQ topic, as this test shows is currently 
possible.
   
   > A quick fix is to close the consumer before ensuring the messages already 
get acked at the broker side?
   
   @codelipenghui - I do not think this solution will work. When a consumer is 
closed, it drops any messages that are in the 
`possibleSendToDeadLetterTopicMessages` without moving them to the DLQ topic. 
That means the messages won't ever make it to the DLQ topic. As I mentioned in 
the annotations above, the DLQ topic consumer is the logic that waits 1 second 
for the original messages to time out and get delivered to the DLQ topic. All 
of the redelivery logic lives within the client, so closing it prematurely will 
lead to improper redelivery semantics.
   
   I noticed while digging into this test that the `redeliveryCount` is not 
maintained from the first consumer to the second one. That seems unexpected to 
me, and I am wondering this is expected.


-- 
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