Class KafkaOpenMetadataEventProducer
java.lang.Object
org.odpi.openmetadata.adapters.eventbus.topic.kafka.KafkaOpenMetadataEventProducer
- All Implemented Interfaces:
Runnable
KafkaOpenMetadataEventProducer manages the sending of events on Apache Kafka. This is done through called to
the Kafka Producer interface.
Kafka is not always running. When this occurs, the call to publish events hangs and this is disruptive to the rest of the server. So the role of this class is to manage the sending of events in a separate thread and manage the logging of errors to alert the operations team that Kafka needs restarting.
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Give time for an error to clear.void
run()
This is the method that provides the behaviour of the thread.void
Normal shutdownvoid
Sends the supplied event to the topic.
-
Method Details
-
run
public void run()This is the method that provides the behaviour of the thread. -
sendEvent
Sends the supplied event to the topic.- Parameters:
event
- OMRSEvent object containing the event properties.
-
recoverAfterError
protected void recoverAfterError()Give time for an error to clear. -
safeCloseProducer
public void safeCloseProducer()Normal shutdown
-