Class AsyncKafkaExporter<T>
java.lang.Object
io.confluent.telemetry.events.exporter.kafka.async.AsyncKafkaExporter<T>
- Type Parameters:
T-
- All Implemented Interfaces:
Exporter<T>, AutoCloseable, org.apache.kafka.common.Configurable, org.apache.kafka.common.Reconfigurable
- Direct Known Subclasses:
EventAsyncKafkaExporter
This KafkaExporter does not block the calling thread. It adds the data to a queue and returns
immediately. A consumer thread drains the queue and sends the data to Kafka.
The exporter emit method returns a CompletableFuture object with a boolean that indicates if event has been sent or dropped, caller can either wait on the result and decide what to do based on result, or ignore the result.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionBlockingDeque<io.confluent.telemetry.events.exporter.kafka.async.AsyncKafkaExporter.Tuple<T>> buffer()voidclose()voidFilter and transform the events as appropriate and send to the specified destination.booleanReturns true if the producer has been created.static <T> AsyncKafkaExporter.Builder<T> producer()Returns the producer if it has been created, null otherwise.voidreconfigure(Map<String, ?> configs) voidvalidateReconfiguration(Map<String, ?> configs) Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Exporter
routeReady
-
Method Details
-
newBuilder
-
reconfigurableConfigs
-
validateReconfiguration
-
reconfigure
-
configure
-
emit
Description copied from interface:ExporterFilter and transform the events as appropriate and send to the specified destination. This method takes care of batching, serialization and retries. -
buffer
public BlockingDeque<io.confluent.telemetry.events.exporter.kafka.async.AsyncKafkaExporter.Tuple<T>> buffer() -
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
producer
Returns the producer if it has been created, null otherwise. With lazy initialization, the producer may not exist until the first emit. -
isProducerCreated
public boolean isProducerCreated()Returns true if the producer has been created.
-