K
- the key type.V
- the value type.public interface KafkaMessageConverter<K,V>
Modifier and Type | Method and Description |
---|---|
org.apache.kafka.clients.producer.ProducerRecord<K,V> |
createKafkaMessage(EventMessage<?> eventMessage,
String topic)
Creates
ProducerRecord for a given EventMessage |
Optional<EventMessage<?>> |
readKafkaMessage(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> consumerRecord)
Reconstruct an EventMessage from the given
ConsumerRecord . |
org.apache.kafka.clients.producer.ProducerRecord<K,V> createKafkaMessage(EventMessage<?> eventMessage, String topic)
ProducerRecord
for a given EventMessage
eventMessage
- the event message to send to Kafka.topic
- the Kafka topic.Optional<EventMessage<?>> readKafkaMessage(org.apache.kafka.clients.consumer.ConsumerRecord<K,V> consumerRecord)
ConsumerRecord
. The returned optional
resolves to a message if the given input parameters represented a correct EventMessage
.consumerRecord
- Event message represented inside kafkaCopyright © 2010–2018. All rights reserved.