K
- the key type.V
- the value type.public static class KafkaMessageSource.KafkaAckCallback<K,V> extends Object implements AcknowledgmentCallback, org.springframework.kafka.support.Acknowledgment
AcknowledgmentCallback.Status
Constructor and Description |
---|
KafkaAckCallback(KafkaMessageSource.KafkaAckInfo<K,V> ackInfo,
org.springframework.kafka.listener.ConsumerProperties consumerProperties)
Construct an instance with the provided properties.
|
Modifier and Type | Method and Description |
---|---|
void |
acknowledge()
Acknowledge the message delivery.
|
void |
acknowledge(AcknowledgmentCallback.Status status)
Acknowledge the message.
|
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.
|
boolean |
isAutoAck()
Return true if this acknowledgment supports auto ack when it has not been
already ack'd by the application.
|
void |
noAutoAck()
Disable auto acknowledgment by a
SourcePollingChannelAdapter
or MessageSourcePollingTemplate . |
public KafkaAckCallback(KafkaMessageSource.KafkaAckInfo<K,V> ackInfo, @Nullable org.springframework.kafka.listener.ConsumerProperties consumerProperties)
ackInfo
- the ack info.consumerProperties
- the consumer properties - only commit-related
properties are used.public void acknowledge(AcknowledgmentCallback.Status status)
AcknowledgmentCallback
acknowledge
in interface AcknowledgmentCallback
status
- the status.public boolean isAcknowledged()
AcknowledgmentCallback
isAcknowledged
in interface AcknowledgmentCallback
public void acknowledge()
SimpleAcknowledgment
acknowledge
in interface AcknowledgmentCallback
acknowledge
in interface SimpleAcknowledgment
acknowledge
in interface org.springframework.kafka.support.Acknowledgment
public void noAutoAck()
AcknowledgmentCallback
SourcePollingChannelAdapter
or MessageSourcePollingTemplate
. Not all implementations support
this - for example, the Kafka message source.noAutoAck
in interface AcknowledgmentCallback
public boolean isAutoAck()
AcknowledgmentCallback
isAutoAck
in interface AcknowledgmentCallback