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

Commit 88d2588

Browse files
authored
Merge pull request #39 from NickTsitlakidis/master
Adding javadoc for AcknowledgableDelivery
2 parents d64bf9a + e9526dc commit 88d2588

File tree

1 file changed

+26
-1
lines changed

1 file changed

+26
-1
lines changed

src/main/java/reactor/rabbitmq/AcknowledgableDelivery.java

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
import java.util.concurrent.atomic.AtomicBoolean;
2424

2525
/**
26-
* A message that can be manually acknowledged.
26+
* A RabbitMQ {@link Delivery} that can be manually acknowledged or rejected.
2727
*/
2828
public class AcknowledgableDelivery extends Delivery {
2929

@@ -43,6 +43,13 @@ public AcknowledgableDelivery(Delivery delivery, Channel channel) {
4343
this.channel = channel;
4444
}
4545

46+
/**
47+
* Acknowledges this message if it has not been previously acked or nacked.
48+
* Subsequent calls to the method for previously acknowledged message will not produce errors and will simply
49+
* return instantly.
50+
* @param multiple Defines whether all messages up to and including the supplied delivery tag should be
51+
* acknowledged or not.
52+
*/
4653
public void ack(boolean multiple) {
4754
if (notAckedOrNacked.getAndSet(false)) {
4855
try {
@@ -57,10 +64,23 @@ public void ack(boolean multiple) {
5764
}
5865
}
5966

67+
/**
68+
* Acknowledges this message if it has not been previously acked or nacked.
69+
* Subsequent calls to the method for previously acknowledged message will not produce errors and will simply
70+
* return instantly.
71+
*/
6072
public void ack() {
6173
ack(false);
6274
}
6375

76+
/**
77+
* Rejects this message if it has not been previously acked or nacked.
78+
* Subsequent calls to the method for previously acknowledged or rejected message will not produce errors and
79+
* will simply return instantly.
80+
* @param multiple Defines whether all messages up to and including the supplied delivery tag should be
81+
* rejected or not.
82+
* @param requeue Defines if the message should be added to the queue again instead of being discarded.
83+
*/
6484
public void nack(boolean multiple, boolean requeue) {
6585
if (notAckedOrNacked.getAndSet(false)) {
6686
try {
@@ -75,6 +95,11 @@ public void nack(boolean multiple, boolean requeue) {
7595
}
7696
}
7797

98+
/**
99+
* Rejects this message if it has not been previously acked or nacked.
100+
* Subsequent calls to the method for previously acknowledged or rejected message will not produce errors and
101+
* will simply return instantly.
102+
*/
78103
public void nack(boolean requeue) {
79104
nack(false, requeue);
80105
}

0 commit comments

Comments
 (0)