Class KafkaProducerMessage<K,V>
- java.lang.Object
-
- io.helidon.messaging.connectors.kafka.KafkaProducerMessage<K,V>
-
- Type Parameters:
K
- the type of Kafka record keyV
- the type of Kafka record value
- All Implemented Interfaces:
KafkaMessage<K,V>
,Message<V>
public class KafkaProducerMessage<K,V> extends Object implements KafkaMessage<K,V>
Kafka specific Micro Profile Reactive Messaging Producer Message.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletionStage<Void>
ack()
Optional<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>>
getConsumerRecord()
ReturnsConsumerRecord
if message was received from Kafka, otherwise returnOptional.empty()
.org.apache.kafka.common.header.Headers
getHeaders()
ReturnsHeaders
received from Kafka with record or empty headers if message was not created by Kafka connector.Optional<K>
getKey()
Key orOptional.empty()
if non is specified.Optional<Long>
getOffset()
Offset of the record in partition from which was this message received.Optional<Integer>
getPartition()
Number of partition from which was this message received.V
getPayload()
Optional<String>
getTopic()
Name of the topic from which was this message received.
-
-
-
Method Detail
-
getTopic
public Optional<String> getTopic()
Description copied from interface:KafkaMessage
Name of the topic from which was this message received.- Specified by:
getTopic
in interfaceKafkaMessage<K,V>
- Returns:
- topic name
-
getPartition
public Optional<Integer> getPartition()
Description copied from interface:KafkaMessage
Number of partition from which was this message received.- Specified by:
getPartition
in interfaceKafkaMessage<K,V>
- Returns:
- partition number
-
getOffset
public Optional<Long> getOffset()
Description copied from interface:KafkaMessage
Offset of the record in partition from which was this message received.- Specified by:
getOffset
in interfaceKafkaMessage<K,V>
- Returns:
- offset number
-
getConsumerRecord
public Optional<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> getConsumerRecord()
Description copied from interface:KafkaMessage
ReturnsConsumerRecord
if message was received from Kafka, otherwise returnOptional.empty()
.- Specified by:
getConsumerRecord
in interfaceKafkaMessage<K,V>
- Returns:
ConsumerRecord
orOptional.empty()
-
getKey
public Optional<K> getKey()
Description copied from interface:KafkaMessage
Key orOptional.empty()
if non is specified.- Specified by:
getKey
in interfaceKafkaMessage<K,V>
- Returns:
- Key or
Optional.empty()
-
getHeaders
public org.apache.kafka.common.header.Headers getHeaders()
Description copied from interface:KafkaMessage
ReturnsHeaders
received from Kafka with record or empty headers if message was not created by Kafka connector.- Specified by:
getHeaders
in interfaceKafkaMessage<K,V>
- Returns:
Headers
received from Kafka or empty headers if message was not created by Kafka connector
-
getPayload
public V getPayload()
- Specified by:
getPayload
in interfaceMessage<K>
-
ack
public CompletionStage<Void> ack()
-
-