Package org.trellisldp.kafka
Class KafkaEventService
- java.lang.Object
-
- org.trellisldp.kafka.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 Summary
Fields Modifier and Type Field Description static String
CONFIG_KAFKA_TOPIC
The configuration key controlling the name of the kafka topic.
-
Constructor Summary
Constructors Constructor Description KafkaEventService()
Create a new Kafka Event Service with a no-op serializer.KafkaEventService(EventSerializationService serializer)
Create a new Kafka Event Service.KafkaEventService(EventSerializationService serializer, Producer<String,String> producer)
Create a new Kafka Event Service.KafkaEventService(EventSerializationService serializer, Producer<String,String> producer, String topic)
Create a new Kafka Event Service.
-
-
-
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 serializerproducer
- the producer
-
KafkaEventService
public KafkaEventService(EventSerializationService serializer, Producer<String,String> producer, String topic)
Create a new Kafka Event Service.- Parameters:
serializer
- the event serializerproducer
- the producertopic
- 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 interfaceEventService
- Parameters:
event
- the event
-
-