merlimat opened a new pull request #3703: Added support for "negative acks" in Java client URL: https://github.com/apache/pulsar/pull/3703 ### Motivation In many cases, it is hard for application to handle the failure of processing a particular message. Currently there are few exposed solutions though these are difficult to apply in a general way. 1. Ack timeout - This trigger the redelivery of messages if they are received by the application and not acknowledged within a certain time. The main issue with this approach is that the "timeout" is inherently associated with what the application processing is doing. In most cases, an ack-timeout of 1min is a perfectly good value, though if the processing takes 3min on average, that would trigger the redelivery of each message multiple times... hence, ack-timeout cannot be turned on by default. 2. Blocking the consumption and handle retries. This is a kind of manual handling of failures that has few drawbacks: * There might be only 1 message failing (possibly temporarely) while the rest of messages is fine. In this case we're anyway stalling the processing of all messages until this one goes through. * The problem might be related to only 1 single consumer instance, while the rest of consumers are fine. To address these cases in a general way is to allow application to signal that a message was not processed successfully and that it would have to be re-delivered, after a configurable delay to avoid a tight loop of redeliveries when there is a temporary downstream issue. If the dead-letter-queue feature is enabled, the number of redeliveries will be capped at a max and then message will routed to the DLQ. Otherwise, the redelivery will continue indefinitely. ### Modifications The implementation is based on the same redelivery scheme used by the ack-timeout although the 2 features are orthogonal and can be used together if desired.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
