Class ErrorLoggingCallback
java.lang.Object
org.apache.kafka.clients.producer.internals.ErrorLoggingCallback
- All Implemented Interfaces:
Callback
-
Constructor Summary
ConstructorsConstructorDescriptionErrorLoggingCallback(String topic, byte[] key, byte[] value, boolean logAsString) -
Method Summary
Modifier and TypeMethodDescriptionvoidonCompletion(RecordMetadata metadata, Exception e) A callback method the user can implement to provide asynchronous handling of request completion.
-
Constructor Details
-
ErrorLoggingCallback
-
-
Method Details
-
onCompletion
Description copied from interface:CallbackA 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. When exception is not null in the callback, metadata will contain the special -1 value for all fields. If topicPartition cannot be chosen, a -1 value will be assigned.- Specified by:
onCompletionin interfaceCallback- Parameters:
metadata- The metadata for the record that was sent (i.e. the partition and offset). An empty metadata with -1 value for all fields will be returned if an error occurred.e- 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):
InvalidTopicExceptionOffsetMetadataTooLargeRecordBatchTooLargeExceptionRecordTooLargeExceptionUnknownServerExceptionUnknownProducerIdExceptionInvalidProducerEpochException
CorruptRecordExceptionInvalidMetadataExceptionNotEnoughReplicasAfterAppendExceptionNotEnoughReplicasExceptionOffsetOutOfRangeExceptionTimeoutExceptionUnknownTopicOrPartitionException
-