NiuBlibing opened a new issue, #23944:
URL: https://github.com/apache/pulsar/issues/23944

   ### Search before asking
   
   - [x] I searched in the [issues](https://github.com/apache/pulsar/issues) 
and found nothing similar.
   
   
   ### Motivation
   
   ### **Description**
   
   Currently, the message redelivery count (RedeliveryCount) only increases 
when the client actively calls the redeliver method 
https://github.com/apache/pulsar/issues/18239. However, in certain 
scenarios—such as when the program runs out of memory or crashes due to an 
unhandled exception—the message is not properly redelivered, and the count does 
not increase.
   
   This can lead to messages being retried indefinitely without entering the 
dead-letter queue (DLQ), affecting system stability and failure recovery.
   
   ### Optimization Proposal
   
   It is recommended to move the logic for increasing RedeliveryCount from the 
client to the Broker side to ensure:
   
   - When a message is consumed but not acknowledged (due to process crashes or 
other issues), the Broker correctly increments RedeliveryCount.
   - Messages reach the dead-letter queue (DLQ) in a timely manner after 
exceeding the maximum retry limit, preventing infinite retries.
   
   ### Solution
   
   - Broker detects consumer disconnection and proactively increments 
RedeliveryCount.
   - Client increases RedeliveryCount when receiving a message.
   
   ### Alternatives
   
   _No response_
   
   ### Anything else?
   
   _No response_
   
   ### Are you willing to submit a PR?
   
   - [ ] I'm willing to submit a PR!


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

To unsubscribe, e-mail: [email protected]

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

Reply via email to