drriguz commented on issue #15341:
URL: https://github.com/apache/pulsar/issues/15341#issuecomment-1139329495
I'm also confused about this, I found that messages are not redelivered in
my application by using the following code:
```java
try {
MetaDataChangedEvent<?> message =
messageDecoder.decodeEvent(msg.getData());
if (message instanceof AppDescriptionChanged) {
messageProcessService.processEvent((AppDescriptionChanged)
message);
} else {
messageProcessService.processEvent((SnapshotEvent<?>)
message);
}
consumer.acknowledge(msg);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
logger.error("Failed to process message {}: interrupted",
msg.getMessageId(), e);
consumer.negativeAcknowledge(msg);
} catch (Exception e) {
// todo: error handling & impl retry strategy
logger.error("Failed to process message {}", msg.getMessageId(),
e);
consumer.negativeAcknowledge(msg);
}
```
The document does not say clearly about that, and there's also someone
asking in Stackoverflow:
https://stackoverflow.com/questions/69590720/pulsar-if-a-message-gets-nackd-negativeacknowledge-when-will-it-be-redeliv
--
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]