-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize RedeliveryCount Handling Mechanism #23944
Comments
In broker side, the redeliverycount also stores in the memory, which means once the broker restart or the topic unload, all the redeliverycount in memory will be clear and after the topic recover, it will all reset to 0. see: If we don't persist redeliverycount, this issue would be meaningless, but, if we persist it, will it bring any benefits? It's hard to say. |
RedeliveryCount is maintained by broker, not client. |
It’s partially correct. You can enable ackTimeout on the consumer. Once the consumer returns a message from the receive method, the countdown starts. A background task runs periodically to redeliver messages that exceed the ackTimeout. |
Yeah, depending on client is not full reliable for these cases. |
Yes, I agree. However, I believe it’s technically sufficient. If your application frequently encounters OOM errors or crashes, you should monitor and address those issues within your application, right? Moreover, one reason the |
I don’t think this is achievable with the current version of the messaging protocol. A key question to consider is: How does the broker determine that messages have been delivered to the application? When messages are dispatched from the broker to the consumer, they might just be placed in the consumer’s |
Agreed, detecting bugs and fixing them is the preferred option in most cases. However, I've come across a scenario where certain payloads cause third-party libraries to generate oom (e.g. processing complex files that can't be directly determined by file size), and it's not easy to go deeper into the third-party libraries and rewrite the relevant logic. I'd like to be able to handle this with the crash retry mechanism in the message queue so that these errors are handled transparently and don't introduce extra work.
Maybe it's also not easy for pulsar to deal the logic in broker without extra performance overload. |
Search before asking
Motivation
Description
Currently, the message redelivery count (RedeliveryCount) only increases when the client actively calls the redeliver method #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:
Solution
Alternatives
No response
Anything else?
No response
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: