Skip to content

Commit 41e2b87

Browse files
authored
Fix polling-consumer.adoc for the actual AcknowledgmentCallback
Signed-off-by: Ma,Jiandong <[email protected]>
1 parent f7ec376 commit 41e2b87

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

src/reference/antora/modules/ROOT/pages/polling-consumer.adoc

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,27 @@ When used with pollable message sources, the value of the header is an instance
6868
[source, java]
6969
----
7070
@FunctionalInterface
71-
public interface AcknowledgmentCallback {
71+
public interface AcknowledgmentCallback extends SimpleAcknowledgment {
7272
7373
void acknowledge(Status status);
7474
75-
boolean isAcknowledged();
75+
@Override
76+
default void acknowledge() {
77+
acknowledge(Status.ACCEPT);
78+
}
79+
80+
default boolean isAcknowledged() {
81+
return false;
82+
}
7683
77-
void noAutoAck();
7884
79-
default boolean isAutoAck();
85+
default void noAutoAck() {
86+
throw new UnsupportedOperationException("You cannot disable auto acknowledgment with this implementation");
87+
}
88+
89+
default boolean isAutoAck() {
90+
return true;
91+
}
8092
8193
enum Status {
8294

0 commit comments

Comments
 (0)