public interface Callback
Modifier and Type | Method and Description |
---|---|
void |
onCompletion(RecordMetadata metadata,
Exception exception)
A callback method the user can implement to provide asynchronous handling of request completion.
|
void onCompletion(RecordMetadata metadata, Exception exception)
metadata
- The metadata for the record that was sent (i.e. the partition and offset). Null if an error
occurred.exception
- The exception thrown during processing of this record. Null if no error occurred.
Possible thrown exceptions include:
Non-Retriable exceptions (fatal, the message will never be sent):
InvalidTopicException
OffsetMetadataTooLargeException
RecordBatchTooLargeException
RecordTooLargeException
UnknownServerException
Retriable exceptions (transient, may be covered by increasing #.retries):
CorruptRecordException
InvalidMetadataException
NotEnoughReplicasAfterAppendException
NotEnoughReplicasException
OffsetOutOfRangeException
TimeoutException
UnknownTopicOrPartitionException