GitHub user harissecic added a comment to the discussion: Support for long 
running message consumer

Stumbled upon this looking for another answer. However in case it helps anyone 
I'll leave a comment. For such cases I guess it's possible to combine DLQ with 
ackTimeout. Default value I use is 3. Although I don't use auto-ack I guess it 
will still work the same way. If message times-out 3 times (in this case) it 
will automatically go to Dead Letter Queue. This will prevent it to loop 
endlessly between services. My example is that I'm building up a module for a 
framework. Now in such case I don't do ackTimeout but let users set it if they 
want to. However, I do by default set 3 retries before DLQ. Reason was personal 
experience where it endlessly looped my test message to the shared consumers 
and I got error logs all the time and couldn't figure it out. Then I realised 
well message is simply getting negativeAck from each consumer and then 
redelivered all the time but funny thing is it was malformed JSON message so 
consumers were doomed to crash (validations falied for previously nulla
 ble thing in kotlin that I moved to non-null). When I set up DLQ to 3 I had 
some messages fail and then get re-read due to timeout for ack. But combining 
DLQ, ackTimeout, and shared consumers I think you can set timeout pretty low if 
processing data takes less time and you do manual ACK as soon as it's done.

GitHub link: 
https://github.com/apache/pulsar/discussions/18456#discussioncomment-4133182

----
This is an automatically sent email for dev@pulsar.apache.org.
To unsubscribe, please send an email to: dev-unsubscr...@pulsar.apache.org

Reply via email to