Class ApacheKafkaProducerCallback

  • All Implemented Interfaces:
    org.apache.kafka.clients.producer.Callback

    public class ApacheKafkaProducerCallback
    extends java.lang.Object
    implements org.apache.kafka.clients.producer.Callback
    A Kafka specific callback which wraps generic PubSubProducerCallback
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void onCompletion​(org.apache.kafka.clients.producer.RecordMetadata metadata, java.lang.Exception kafkaException)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ApacheKafkaProducerCallback

        public ApacheKafkaProducerCallback​(PubSubProducerCallback pubsubProducerCallback)
    • Method Detail

      • onCompletion

        public void onCompletion​(org.apache.kafka.clients.producer.RecordMetadata metadata,
                                 java.lang.Exception kafkaException)
        Specified by:
        onCompletion in interface org.apache.kafka.clients.producer.Callback
        Parameters:
        metadata - The metadata for the record that was sent (i.e. the partition and offset). NULL if an error occurred.
        kafkaException - 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