Acknowledge successfully processed messages individually with consumer.acknowledge(msg) or in batch with consumer.acknowledgeCumulative(msg) (cumulative only for Exclusive/Failover subscriptions).
On processing failure, call consumer.negativeAcknowledge(msg) to signal Pulsar to redeliver the message after a configurable redelivery delay.
Configure the negative-ack redelivery delay via ConsumerBuilder.negativeAckRedeliveryDelay(duration) to avoid tight redelivery loops.
Set an ack timeout with ConsumerBuilder.ackTimeout(duration, timeUnit) to automatically request redelivery of unacknowledged messages after the timeout expires.
For persistent failures, configure a Dead Letter Topic (DLT) via ConsumerBuilder.deadLetterPolicy so messages exceeding the max redelivery count are moved to the DLT automatically.
Known gotchas
Cumulative acknowledgment acknowledges all messages up to and including the given message ID; do not use it with Shared subscriptions where ordering is not guaranteed.
Ack timeout and negative ack interact: if both are set, the shorter interval determines when redelivery is requested; tune to avoid duplicate redeliveries.
Dead Letter Topic requires the DLT to exist or for Pulsar to auto-create it; verify namespace policies allow auto-creation or create the DLT explicitly.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp