This repository was archived by the owner on Sep 26, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed
test/java/reactor/rabbitmq/docs Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff 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
387387When 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
389393retry support when acknowledging a message:
390394
391395[source,java,indent=0]
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments