Interface AcknowledgementCommitCallback
A callback interface that the user can implement to trigger custom actions when an acknowledgement completes.
The callback may be executed in any thread calling
ShareConsumer.poll(java.time.Duration)
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
onComplete
(Map<TopicIdPartition, Set<Long>> offsets, Exception exception) A callback method the user can implement to provide asynchronous handling of acknowledgement completion.
-
Method Details
-
onComplete
A callback method the user can implement to provide asynchronous handling of acknowledgement completion. This method will be called when the acknowledgement request sent to the server has been completed.- Parameters:
offsets
- A map of the offsets that this callback applies to.exception
- The exception thrown during processing of the request, or null if the acknowledgement completed successfully.-
AuthorizationException
if not authorized to the topic or group -
InvalidRecordStateException
if the record state is invalid -
NotLeaderOrFollowerException
if the leader had changed by the time the acknowledgements were sent -
DisconnectException
if the broker disconnected before the request could be completed -
WakeupException
ifKafkaShareConsumer.wakeup()
is called before or while this function is called -
InterruptException
if the calling thread is interrupted before or while this function is called -
KafkaException
for any other unrecoverable errors
Note that even if the exception is a retriable exception, the acknowledgement could not be completed and the records need to be fetched again. The callback is called after any retries have been performed.
-
-