Class KafkaOpenMetadataEventProducer

java.lang.Object
org.odpi.openmetadata.adapters.eventbus.topic.kafka.KafkaOpenMetadataEventProducer
All Implemented Interfaces:
Runnable

public class KafkaOpenMetadataEventProducer extends Object implements 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 Details

    • run

      public void run()
      This is the method that provides the behaviour of the thread.
      Specified by:
      run in interface Runnable
    • sendEvent

      public void sendEvent(String event)
      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