Class KafkaMessageSource.KafkaAckCallback<K,V>
java.lang.Object
org.springframework.integration.kafka.inbound.KafkaMessageSource.KafkaAckCallback<K,V>
- Type Parameters:
K- the key type.V- the value type.
- All Implemented Interfaces:
AcknowledgmentCallback,SimpleAcknowledgment,org.springframework.kafka.support.Acknowledgment
- Enclosing class:
KafkaMessageSource<K,V>
public static class KafkaMessageSource.KafkaAckCallback<K,V>
extends Object
implements AcknowledgmentCallback, org.springframework.kafka.support.Acknowledgment
AcknowledgmentCallback for Kafka.
- Since:
- 5.4
- Author:
- Gary Russell, Mark Norkin, Artem Bilan, Anshul Mehra, Christian Tzolov, Ngoc Nhan
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.acks.AcknowledgmentCallback
AcknowledgmentCallback.Status -
Constructor Summary
ConstructorsConstructorDescriptionKafkaAckCallback(KafkaMessageSource.KafkaAckInfo<K, V> ackInfo, org.springframework.kafka.listener.ConsumerProperties consumerProperties) Construct an instance with the provided properties. -
Method Summary
Modifier and TypeMethodDescriptionvoidAcknowledge the message delivery.voidAcknowledge the message.booleanImplementations must implement this to indicate when the ack has been processed by the user so that the framework can auto-ack if needed.booleanReturn true if this acknowledgment supports auto ack when it has not been already ack'd by the application.voidDisable auto acknowledgment by aSourcePollingChannelAdapterorMessageSourcePollingTemplate.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.kafka.support.Acknowledgment
acknowledge, isOutOfOrderCommit, nack, nack
-
Constructor Details
-
KafkaAckCallback
public KafkaAckCallback(KafkaMessageSource.KafkaAckInfo<K, V> ackInfo, @Nullable org.springframework.kafka.listener.ConsumerProperties consumerProperties) Construct an instance with the provided properties.- Parameters:
ackInfo- the ack info.consumerProperties- the consumer properties - only commit-related properties are used.
-
-
Method Details
-
acknowledge
Description copied from interface:AcknowledgmentCallbackAcknowledge the message.- Specified by:
acknowledgein interfaceAcknowledgmentCallback- Parameters:
status- the status.
-
isAcknowledged
public boolean isAcknowledged()Description copied from interface:AcknowledgmentCallbackImplementations must implement this to indicate when the ack has been processed by the user so that the framework can auto-ack if needed.- Specified by:
isAcknowledgedin interfaceAcknowledgmentCallback- Returns:
- true if the message is already acknowledged.
-
acknowledge
public void acknowledge()Description copied from interface:SimpleAcknowledgmentAcknowledge the message delivery.- Specified by:
acknowledgein interfaceorg.springframework.kafka.support.Acknowledgment- Specified by:
acknowledgein interfaceAcknowledgmentCallback- Specified by:
acknowledgein interfaceSimpleAcknowledgment
-
noAutoAck
public void noAutoAck()Description copied from interface:AcknowledgmentCallbackDisable auto acknowledgment by aSourcePollingChannelAdapterorMessageSourcePollingTemplate. Not all implementations support this - for example, the Kafka message source.- Specified by:
noAutoAckin interfaceAcknowledgmentCallback
-
isAutoAck
public boolean isAutoAck()Description copied from interface:AcknowledgmentCallbackReturn true if this acknowledgment supports auto ack when it has not been already ack'd by the application.- Specified by:
isAutoAckin interfaceAcknowledgmentCallback- Returns:
- true if auto ack is supported.
-