Interface AcknowledgmentCallback
- All Superinterfaces:
SimpleAcknowledgment
- All Known Implementing Classes:
AmqpMessageSource.AmqpAckCallback
,KafkaMessageSource.KafkaAckCallback
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface AcknowledgmentCallback extends SimpleAcknowledgment
A general abstraction over acknowledgments.
- Since:
- 5.0.1
- Author:
- Gary Russell
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
AcknowledgmentCallback.Status
-
Method Summary
Modifier and Type Method Description default void
acknowledge()
Acknowledge the message delivery.void
acknowledge(AcknowledgmentCallback.Status status)
Acknowledge the message.default boolean
isAcknowledged()
Implementations must implement this to indicate when the ack has been processed by the user so that the framework can auto-ack if needed.default boolean
isAutoAck()
Return true if this acknowledgment supports auto ack when it has not been already ack'd by the application.default void
noAutoAck()
Disable auto acknowledgment by aSourcePollingChannelAdapter
orMessageSourcePollingTemplate
.
-
Method Details
-
acknowledge
Acknowledge the message.- Parameters:
status
- the status.
-
acknowledge
default void acknowledge()Description copied from interface:SimpleAcknowledgment
Acknowledge the message delivery.- Specified by:
acknowledge
in interfaceSimpleAcknowledgment
-
isAcknowledged
default boolean isAcknowledged()Implementations must implement this to indicate when the ack has been processed by the user so that the framework can auto-ack if needed.- Returns:
- true if the message is already acknowledged.
-
noAutoAck
default void noAutoAck()Disable auto acknowledgment by aSourcePollingChannelAdapter
orMessageSourcePollingTemplate
. Not all implementations support this - for example, the Kafka message source. -
isAutoAck
default boolean isAutoAck()Return true if this acknowledgment supports auto ack when it has not been already ack'd by the application.- Returns:
- true if auto ack is supported.
-