Package com.networknt.kafka.producer
Interface LightProducer
-
- All Known Subinterfaces:
NativeLightProducer,QueuedLightProducer
- All Known Implementing Classes:
SidecarProducer,TransactionalProducer
public interface LightProducerA generic Kafka producer that can handle the header propagation with open and close methods to be called from the startup and shutdown hooks.- Author:
- Steve Hu
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()This method is called by a shutdown hook to close the producer if it is not null.voidopen()This method is used to create an instance of producer in a startup hook for most of the producers.
-
-
-
Method Detail
-
open
void open()
This method is used to create an instance of producer in a startup hook for most of the producers. Queued producer will start a background thread to process the queued message in batch and this method can be used to start the thread in a startup hook.
-
close
void close()
This method is called by a shutdown hook to close the producer if it is not null.
-
-