kellyfj
kellyfj

Reputation: 6923

Pulsar: If a message gets nack'd (negativeAcknowledge()) when will it be redelivered?

If we cannot process a message (perhaps due to some timing problem or race condition) and we call

consumer.negativeAcknowledge(messageId);

When will it be redelivered to retry processing?

I am unable to figure out what the default setting for delivery is from the documentation

Upvotes: 2

Views: 1424

Answers (1)

Matteo Merli
Matteo Merli

Reputation: 785

The default is 60 seconds. You can configure it in the consumer:

Consumer<byte[]> consumer = client.newConsumer()
    .topic("my-topic")
    .subscriptionName("my-sub")
    .negativeAckRedelivery(10, TimeUnit.SECONDS)
    .subscribe()

Upvotes: 3

Related Questions