Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.

Commit 2f37e3d

Browse files
committed
consumeManualAck connection failure documentation update
1 parent 0749389 commit 2f37e3d

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

src/docs/asciidoc/api-guide.adoc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,11 @@ include::{test-examples}/ApiGuideReceiver.java[tag=auto-ack-retry-settings]
385385
<1> Retry acknowledgment for 20 seconds every 500 milliseconds on connection failure
386386

387387
When using `Receiver#consumeManualAck`, acknowledgment is handled by the developer, who
388-
can do pretty anything they want on acknowledgment failure. It is possible to benefit from Reactor RabbitMQ
388+
can do pretty anything they want on acknowledgment failure.
389+
390+
`AcknowledgableDelivery#ack` and `AcknowledgableDelivery#nack` methods handle retry internally
391+
based on `BiConsumer<Receiver.AcknowledgmentContext, Exception> exceptionHandler` in the `ConsumeOptions`.
392+
Developer does not have to execute retry explicitly on acknowledgment failure and benefits from Reactor RabbitMQ
389393
retry support when acknowledging a message:
390394

391395
[source,java,indent=0]

src/test/java/reactor/rabbitmq/docs/ApiGuideReceiver.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,11 +91,12 @@ void manualAckRetry() {
9191
Duration.ofSeconds(20), Duration.ofMillis(500),
9292
ExceptionHandlers.CONNECTION_RECOVERY_PREDICATE
9393
);
94-
receiver.consumeManualAck("queue")
95-
.subscribe(msg -> {
96-
// ... // <2>
97-
msg.ack(); // <3>
98-
});
94+
receiver.consumeManualAck("queue",
95+
new ConsumeOptions().exceptionHandler(exceptionHandler))
96+
.subscribe(msg -> {
97+
// ... // <2>
98+
msg.ack(); // <3>
99+
});
99100
// end::manual-ack-retry[]
100101
}
101102

0 commit comments

Comments
 (0)