You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[feat] Add a new ack timeout mode where a callback is called instead of nacking the message #23262
I searched in the issues and found nothing similar.
Motivation
When a Pulsar application has ordered processing requirements, it's necessary to use either Failover, Exclusive or Key_Shared subscriptions. Ack timeouts shouldn't be used at all since this could cause messages to be processed in the wrong order. The application should take responsibility of handling possible error cases.
Since ack timeouts aren't used, there's a chance that the application logic contains a bug and the application doesn't acknowledge a message. Detecting this is very hard currently. It's hard to tell whether lost acks are caused by a Pulsar bug or feature or it's a problem caused by the application. This should be made easier.
Solution
Since Pulsar already contains the ack timeout feature, it would be natural to use it as the basis for detecting when the application is not acknowledging a message in time.
example of configuring the ack timeout handler:
consumerBuilder.ackTimeout(10, TimeUnit.SECOND)
.ackTimeoutHandler((consumer, messageIds) -> messageIds.forEach(messageId -> log.warn("message with id {} wasn't acknowledged!", messageId))
I have a doubt. Based on the discussion here, ackTimout is a legacy feature; do we still need to add new functionalities for this feature?
@crossoverJie Thanks for sharing. Perhaps we rename this completely. :) However, it doesn't take away the usefulness of having a way to detect when the application is possibly misbehaving and missing to acknowledge a message.
Activity
crossoverJie commentedon Sep 6, 2024
apache/pulsar-client-go#403 (comment)
apache/pulsar-client-go#217 (comment)
I have a doubt. Based on the discussion here,
ackTimoutis a legacy feature; do we still need to add new functionalities for this feature?lhotari commentedon Sep 9, 2024
@crossoverJie Thanks for sharing. Perhaps we rename this completely. :) However, it doesn't take away the usefulness of having a way to detect when the application is possibly misbehaving and missing to acknowledge a message.
merlimat commentedon Oct 24, 2026
Thanks @lhotari. This adds new public client API (a builder option and a handler interface), so it needs a Pulsar Improvement Proposal: https://github.com/apache/pulsar/blob/master/pip/README.md. The 5.0 V5 client API drops ack timeout entirely. A PIP would need to decide whether this becomes a separately named "unacknowledged message detection" hook (as discussed with @crossoverJie) and whether it targets the v4 API, V5 or both. I'm closing this issue for now, and a PIP is welcome.