Fix polling-consumer.adoc for the actual AcknowledgmentCallback

Signed-off-by: Ma,Jiandong <jiandong.ma.cn@gmail.com>
This commit is contained in:
Jiandong
2025-04-07 21:03:06 +08:00
committed by GitHub
parent f7ec3762ec
commit 41e2b873f2

View File

@@ -68,15 +68,27 @@ When used with pollable message sources, the value of the header is an instance
[source, java]
----
@FunctionalInterface
public interface AcknowledgmentCallback {
public interface AcknowledgmentCallback extends SimpleAcknowledgment {
void acknowledge(Status status);
boolean isAcknowledged();
@Override
default void acknowledge() {
acknowledge(Status.ACCEPT);
}
void noAutoAck();
default boolean isAcknowledged() {
return false;
}
default boolean isAutoAck();
default void noAutoAck() {
throw new UnsupportedOperationException("You cannot disable auto acknowledgment with this implementation");
}
default boolean isAutoAck() {
return true;
}
enum Status {