You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2024/09/05 16:15:25 UTC
[I] [feat] Add a new ack timeout mode where a callback is called instead of nacking the message [pulsar]
lhotari opened a new issue, #23262:
URL: https://github.com/apache/pulsar/issues/23262
### Search before asking
- [X] I searched in the [issues](https://github.com/apache/pulsar/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](https://pulsar.apache.org/docs/3.3.x/concepts-messaging/#acknowledgment-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:
```java
consumerBuilder.ackTimeout(10, TimeUnit.SECOND)
.ackTimeoutHandler((consumer, messageIds) -> messageIds.forEach(messageId -> log.warn("message with id {} wasn't acknowledged!", messageId))
```
interface:
```java
import java.util.Set;
import org.apache.pulsar.client.api.Consumer;
import org.apache.pulsar.client.api.MessageId;
public interface AckHandler {
void handleAckTimeout(Consumer<?> consumer, Set<MessageId> messageIds);
}
```
When the `ackTimeoutHandler` is configured, the `ackTimeoutRedeliveryBackoff` setting is ignored.
### Alternatives
-
### Anything else?
-
### Are you willing to submit a PR?
- [X] 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: commits-unsubscribe@pulsar.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [feat] Add a new ack timeout mode where a callback is called instead of nacking the message [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat closed issue #23262: [feat] Add a new ack timeout mode where a callback is called instead of nacking the message
URL: https://github.com/apache/pulsar/issues/23262
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [feat] Add a new ack timeout mode where a callback is called instead of nacking the message [pulsar]
Posted by "merlimat (via GitHub)" <gi...@apache.org>.
merlimat commented on issue #23262:
URL: https://github.com/apache/pulsar/issues/23262#issuecomment-6388752106
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.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [feat] Add a new ack timeout mode where a callback is called instead of nacking the message [pulsar]
Posted by "crossoverJie (via GitHub)" <gi...@apache.org>.
crossoverJie commented on issue #23262:
URL: https://github.com/apache/pulsar/issues/23262#issuecomment-2333068805
https://github.com/apache/pulsar-client-go/issues/403#issuecomment-735995132
https://github.com/apache/pulsar-client-go/issues/217#issuecomment-619384515
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?
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [feat] Add a new ack timeout mode where a callback is called instead of nacking the message [pulsar]
Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on issue #23262:
URL: https://github.com/apache/pulsar/issues/23262#issuecomment-2338604861
> [apache/pulsar-client-go#403 (comment)](https://github.com/apache/pulsar-client-go/issues/403#issuecomment-735995132) [apache/pulsar-client-go#217 (comment)](https://github.com/apache/pulsar-client-go/issues/217#issuecomment-619384515)
>
> 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.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org