public class DefaultProducerListener extends java.lang.Object implements ProducerListener
| Constructor and Description |
|---|
DefaultProducerListener() |
| 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)
|
public 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)
ProducerListeneronSuccess in interface ProducerListenertopic - 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 operationpublic void onError(java.lang.String topic,
java.lang.Integer partition,
java.lang.Object key,
java.lang.Object value,
java.lang.Exception exception)
ProducerListeneronError in interface ProducerListenertopic - 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