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()ReturnsConsumerRecordif message was received from Kafka, otherwise returnOptional.empty().org.apache.kafka.common.header.HeadersgetHeaders()ReturnsHeadersreceived 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.VgetPayload()Optional<String>getTopic()Name of the topic from which was this message received.
-
-
-
Method Detail
-
getTopic
public Optional<String> getTopic()
Description copied from interface:KafkaMessageName of the topic from which was this message received.- Specified by:
getTopicin interfaceKafkaMessage<K,V>- Returns:
- topic name
-
getPartition
public Optional<Integer> getPartition()
Description copied from interface:KafkaMessageNumber of partition from which was this message received.- Specified by:
getPartitionin interfaceKafkaMessage<K,V>- Returns:
- partition number
-
getOffset
public Optional<Long> getOffset()
Description copied from interface:KafkaMessageOffset of the record in partition from which was this message received.- Specified by:
getOffsetin interfaceKafkaMessage<K,V>- Returns:
- offset number
-
getConsumerRecord
public Optional<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> getConsumerRecord()
Description copied from interface:KafkaMessageReturnsConsumerRecordif message was received from Kafka, otherwise returnOptional.empty().- Specified by:
getConsumerRecordin interfaceKafkaMessage<K,V>- Returns:
ConsumerRecordorOptional.empty()
-
getKey
public Optional<K> getKey()
Description copied from interface:KafkaMessageKey orOptional.empty()if non is specified.- Specified by:
getKeyin interfaceKafkaMessage<K,V>- Returns:
- Key or
Optional.empty()
-
getHeaders
public org.apache.kafka.common.header.Headers getHeaders()
Description copied from interface:KafkaMessageReturnsHeadersreceived from Kafka with record or empty headers if message was not created by Kafka connector.- Specified by:
getHeadersin interfaceKafkaMessage<K,V>- Returns:
Headersreceived from Kafka or empty headers if message was not created by Kafka connector
-
getPayload
public V getPayload()
- Specified by:
getPayloadin interfaceMessage<K>
-
ack
public CompletionStage<Void> ack()
-
-