Interface Callback
-
public interface Callback
A callback interface that the user can implement to allow code to execute when the request is complete. This callback will generally execute in the background I/O thread so it should be fast.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
onCompletion(RecordMetadata metadata, java.lang.Exception exception)
A callback method the user can implement to provide asynchronous handling of request completion.
-
-
-
Method Detail
-
onCompletion
void onCompletion(RecordMetadata metadata, java.lang.Exception exception)
A callback method the user can implement to provide asynchronous handling of request completion. This method will be called when the record sent to the server has been acknowledged. Exactly one of the arguments will be non-null.- Parameters:
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
-
-