Class IncomingKafkaRecordMetadata<K,T>
- java.lang.Object
-
- io.smallrye.reactive.messaging.kafka.api.IncomingKafkaRecordMetadata<K,T>
-
- Type Parameters:
K- The Kafka record key typeT- The payload type
- All Implemented Interfaces:
KafkaMessageMetadata<K>
- Direct Known Subclasses:
IncomingKafkaRecordMetadata
public class IncomingKafkaRecordMetadata<K,T> extends Object implements KafkaMessageMetadata<K>
Contains information about messages received from a channel backed by Kafka. Generally this will be created by the framework, and users should not construct instances of this class.
-
-
Constructor Summary
Constructors Constructor Description IncomingKafkaRecordMetadata(org.apache.kafka.clients.consumer.ConsumerRecord<K,T> record)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.kafka.common.header.HeadersgetHeaders()Get the Kafka headersKgetKey()Get the keylonggetOffset()Get the offsetintgetPartition()Get the partitionorg.apache.kafka.clients.consumer.ConsumerRecord<K,T>getRecord()Get the underlying Kafka ConsumerRecordInstantgetTimestamp()Get the timestamporg.apache.kafka.common.record.TimestampTypegetTimestampType()Get the timestamp typeStringgetTopic()Get the topic
-
-
-
Method Detail
-
getTopic
public String getTopic()
Get the topic- Specified by:
getTopicin interfaceKafkaMessageMetadata<K>- Returns:
- the name of the topic
-
getKey
public K getKey()
Get the key- Specified by:
getKeyin interfaceKafkaMessageMetadata<K>- Returns:
- the key
-
getPartition
public int getPartition()
Get the partition- Specified by:
getPartitionin interfaceKafkaMessageMetadata<K>- Returns:
- the partition
-
getTimestamp
public Instant getTimestamp()
Get the timestamp- Specified by:
getTimestampin interfaceKafkaMessageMetadata<K>- Returns:
- the timestamp
-
getTimestampType
public org.apache.kafka.common.record.TimestampType getTimestampType()
Get the timestamp type- Returns:
- the timestamp type
-
getOffset
public long getOffset()
Get the offset- Returns:
- the offset
-
getHeaders
public org.apache.kafka.common.header.Headers getHeaders()
Get the Kafka headers- Specified by:
getHeadersin interfaceKafkaMessageMetadata<K>- Returns:
- the Kafka headers
-
-