<@U078Y59KC3B> how do retries on NACK work in Puls...
# ask-ai
s
@RunLLM how do retries on NACK work in Pulsar?
r
In Apache Pulsar, when a message is negatively acknowledged (NACKed), it is marked for redelivery after a specified delay. This delay can be configured using the
negativeAckRedeliveryDelay
parameter when constructing the consumer. The NACK mechanism allows consumers to signal the broker that a message was not processed successfully, prompting the broker to redeliver the message after the delay. This process is non-blocking and can be applied to individual messages or batches of messages. For more advanced control over redelivery timing, Pulsar supports a redelivery backoff mechanism. This allows messages to be redelivered with varying delays, which can be configured using the
negativeAckRedeliveryBackoff
parameter. This backoff mechanism is useful for implementing exponential backoff strategies, where the delay between redeliveries increases with each attempt. According to the Pulsar documentation, this feature helps manage message processing failures more effectively. Would you like more details on configuring these parameters or examples of their usage? Sources: - Pulsar documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.
s
@RunLLM can you help me understand how it works in the context of the Go pulsar client library?
r
In the context of the Go Pulsar client library, when a message is negatively acknowledged using the
Nack
method, it is marked for redelivery after a delay specified by the
NackRedeliveryDelay
parameter in the
ConsumerOptions
. This delay is set when creating the consumer and determines how long the broker waits before attempting to redeliver the message. The
Nack
method is non-blocking and can be used to handle individual message failures. The Go client also supports a
NackBackoffPolicy
, which allows for more flexible control over redelivery delays. This policy can be configured to implement strategies like exponential backoff, where the delay increases with each redelivery attempt. According to the Go client documentation, the
NackBackoffPolicy
can be set in the
ConsumerOptions
to customize the redelivery behavior based on the number of redelivery attempts. Would you like more detailed information on configuring these options or examples of their usage in code? Sources: - Go client documentation - Pulsar documentation 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.