public interface ProducerListener
Callbacks,
which, in all but the most trivial cases, requires creating a separate instance per message.Callback| Modifier and Type | Method and Description |
|---|---|
void |
onError(java.lang.String topic,
java.lang.Integer partition,
java.lang.Object key,
java.lang.Object value,
java.lang.Exception exception)
Invoked after an attempt to send a message has failed
|
void |
onSuccess(java.lang.String topic,
java.lang.Integer partition,
java.lang.Object key,
java.lang.Object value,
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)
|
void onSuccess(java.lang.String topic,
java.lang.Integer partition,
java.lang.Object key,
java.lang.Object value,
org.apache.kafka.clients.producer.RecordMetadata 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 operationvoid onError(java.lang.String topic,
java.lang.Integer partition,
java.lang.Object key,
java.lang.Object value,
java.lang.Exception 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