K - the key type.V - the value type.public interface ProducerListener<K,V>
Callbacks,
which, in all but the most trivial cases, requires creating a separate instance per message.Callback| Modifier and Type | Method and Description |
|---|---|
default boolean |
isInterestedInSuccess()
Deprecated.
the result of this method will be ignored.
|
default void |
onError(org.apache.kafka.clients.producer.ProducerRecord<K,V> producerRecord,
java.lang.Exception exception)
Invoked after an attempt to send a message has failed.
|
default void |
onError(java.lang.String topic,
java.lang.Integer partition,
K key,
V value,
java.lang.Exception exception)
Deprecated.
in favor of
onError(ProducerRecord, Exception). |
default void |
onSuccess(org.apache.kafka.clients.producer.ProducerRecord<K,V> producerRecord,
org.apache.kafka.clients.producer.RecordMetadata recordMetadata)
Invoked after the successful send of a message (that is, after it has been acknowledged by the broker).
|
default void |
onSuccess(java.lang.String topic,
java.lang.Integer partition,
K key,
V value,
org.apache.kafka.clients.producer.RecordMetadata recordMetadata)
Deprecated.
in favor of
onSuccess(ProducerRecord, RecordMetadata). |
default void onSuccess(org.apache.kafka.clients.producer.ProducerRecord<K,V> producerRecord, org.apache.kafka.clients.producer.RecordMetadata recordMetadata)
producerRecord - the actual sent recordrecordMetadata - the result of the successful send operation@Deprecated
default void onSuccess(java.lang.String topic,
java.lang.Integer partition,
K key,
V value,
org.apache.kafka.clients.producer.RecordMetadata recordMetadata)
onSuccess(ProducerRecord, RecordMetadata).topic - the destination topicpartition - the destination partition (could be null)key - the key of the outbound messagevalue - the payload of the outbound messagerecordMetadata - the result of the successful send operationdefault void onError(org.apache.kafka.clients.producer.ProducerRecord<K,V> producerRecord, java.lang.Exception exception)
producerRecord - the failed recordexception - the exception thrown@Deprecated
default void onError(java.lang.String topic,
java.lang.Integer partition,
K key,
V value,
java.lang.Exception exception)
onError(ProducerRecord, Exception).topic - the destination topicpartition - the destination partition (could be null)key - the key of the outbound messagevalue - the payload of the outbound messageexception - the exception thrown@Deprecated default boolean isInterestedInSuccess()