public class KafkaExporter<T> extends Object implements Exporter<T>
| Modifier and Type | Field and Description |
|---|---|
protected KafkaExporterConfig |
config |
protected AtomicLong |
droppedEventCount |
protected AtomicReference<Exception> |
droppedEventException |
protected Predicate<T> |
filter |
protected long |
lastLoggedCount |
protected long |
lastLoggedTimestamp |
protected Function<T,org.apache.kafka.clients.producer.ProducerRecord<String,byte[]>> |
responseDeserializer |
protected String |
topicName |
| Constructor and Description |
|---|
KafkaExporter() |
KafkaExporter(Function<Properties,org.apache.kafka.clients.producer.Producer<String,byte[]>> producerFactory) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
configure(Map<String,?> configs) |
void |
emit(T data)
Filter and transform the events as appropriate and send to the specified destination.
|
org.apache.kafka.clients.producer.Producer<String,byte[]> |
producer() |
Set<String> |
reconfigurableConfigs() |
void |
reconfigure(Map<String,?> configs) |
void |
validateReconfiguration(Map<String,?> configs) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitrouteReadyprotected final AtomicLong droppedEventCount
protected final AtomicReference<Exception> droppedEventException
protected Function<T,org.apache.kafka.clients.producer.ProducerRecord<String,byte[]>> responseDeserializer
protected long lastLoggedTimestamp
protected long lastLoggedCount
protected String topicName
protected KafkaExporterConfig config
public KafkaExporter()
public KafkaExporter(Function<Properties,org.apache.kafka.clients.producer.Producer<String,byte[]>> producerFactory)
public void configure(Map<String,?> configs)
configure in interface org.apache.kafka.common.Configurablepublic void emit(T data)
Exporterpublic void close()
throws Exception
close in interface AutoCloseableExceptionpublic Set<String> reconfigurableConfigs()
reconfigurableConfigs in interface org.apache.kafka.common.Reconfigurablepublic void validateReconfiguration(Map<String,?> configs) throws org.apache.kafka.common.config.ConfigException
validateReconfiguration in interface org.apache.kafka.common.Reconfigurableorg.apache.kafka.common.config.ConfigExceptionpublic void reconfigure(Map<String,?> configs)
reconfigure in interface org.apache.kafka.common.Reconfigurablepublic org.apache.kafka.clients.producer.Producer<String,byte[]> producer()