Class KafkaProducerMessage<K,V>

java.lang.Object
io.helidon.messaging.connectors.kafka.KafkaProducerMessage<K,V>
Type Parameters:
K - the type of Kafka record key
V - 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 Details

    • getTopic

      public Optional<String> getTopic()
      Description copied from interface: KafkaMessage
      Name of the topic from which was this message received.
      Specified by:
      getTopic in interface KafkaMessage<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 interface KafkaMessage<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 interface KafkaMessage<K,V>
      Returns:
      offset number
    • getConsumerRecord

      public Optional<org.apache.kafka.clients.consumer.ConsumerRecord<K,V>> getConsumerRecord()
      Description copied from interface: KafkaMessage
      Returns ConsumerRecord if message was received from Kafka, otherwise return Optional.empty().
      Specified by:
      getConsumerRecord in interface KafkaMessage<K,V>
      Returns:
      ConsumerRecord or Optional.empty()
    • getKey

      public Optional<K> getKey()
      Description copied from interface: KafkaMessage
      Key or Optional.empty() if non is specified.
      Specified by:
      getKey in interface KafkaMessage<K,V>
      Returns:
      Key or Optional.empty()
    • getHeaders

      public org.apache.kafka.common.header.Headers getHeaders()
      Description copied from interface: KafkaMessage
      Returns Headers received from Kafka with record or empty headers if message was not created by Kafka connector.
      Specified by:
      getHeaders in interface KafkaMessage<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 interface Message<K>
    • ack

      public CompletionStage<Void> ack()
      Specified by:
      ack in interface Message<K>