Class KafkaEventService

  • All Implemented Interfaces:
    EventService

    public class KafkaEventService
    extends Object
    implements EventService
    A Kafka message producer capable of publishing messages to a Kafka cluster.
    • Field Detail

      • CONFIG_KAFKA_TOPIC

        public static final String CONFIG_KAFKA_TOPIC
        The configuration key controlling the name of the kafka topic.
        See Also:
        Constant Field Values
    • Constructor Detail

      • KafkaEventService

        public KafkaEventService()
        Create a new Kafka Event Service with a no-op serializer.
        API Note:
        This construtor is used by CDI runtimes that require a public, no-argument constructor. It should not be invoked directly in user code.
      • KafkaEventService

        @Inject
        public KafkaEventService​(EventSerializationService serializer)
        Create a new Kafka Event Service.
        Parameters:
        serializer - the event serializer
      • KafkaEventService

        public KafkaEventService​(EventSerializationService serializer,
                                 Producer<String,​String> producer)
        Create a new Kafka Event Service.
        Parameters:
        serializer - the event serializer
        producer - the producer
      • KafkaEventService

        public KafkaEventService​(EventSerializationService serializer,
                                 Producer<String,​String> producer,
                                 String topic)
        Create a new Kafka Event Service.
        Parameters:
        serializer - the event serializer
        producer - the producer
        topic - the name of the kafka topic
    • Method Detail

      • emit

        public void emit​(Event event)
        Description copied from interface: EventService
        Emit an event to the event service.
        Specified by:
        emit in interface EventService
        Parameters:
        event - the event