com.github.shoothzj.kafka.producer.DemoProducerCallback Maven / Gradle / Ivy
package com.github.shoothzj.kafka.producer;
import org.apache.kafka.clients.producer.Callback;
import org.apache.kafka.clients.producer.RecordMetadata;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class DemoProducerCallback implements Callback {
private static final Logger log = LoggerFactory.getLogger(DemoProducerCallback.class);
@Override
public void onCompletion(RecordMetadata metadata, Exception exception) {
if (exception != null) {
log.error("send message async exception ", exception);
}
}
}