Class KafkaClient

java.lang.Object
infrastructure.events.KafkaClient
All Implemented Interfaces:
EventManager, EventSender

public class KafkaClient extends Object implements EventManager, EventSender
This class manage the Kafka client needed to consume events.
  • Constructor Details

    • KafkaClient

      protected KafkaClient()
      Default constructor.
  • Method Details

    • getInstance

      public static KafkaClient getInstance()
      Obtain the current instance of the Kafka Client.
      Returns:
      the kafka client.
    • notify

      public final void notify(Event<?> eventToSend)
      Description copied from interface: EventSender
      Method used to send an event through the sender.
      Specified by:
      notify in interface EventSender
      Parameters:
      eventToSend - the event to send.
    • poll

      public final void poll(Consumer<Event<?>> eventConsumer)
      Description copied from interface: EventManager
      Method used to consume events via polling providing a consumer to process them.
      Specified by:
      poll in interface EventManager
      Parameters:
      eventConsumer - the consumer used to consume the event.