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.Headers
getHeaders()
Get the Kafka headersK
getKey()
Get the keylong
getOffset()
Get the offsetint
getPartition()
Get the partitionorg.apache.kafka.clients.consumer.ConsumerRecord<K,T>
getRecord()
Get the underlying Kafka ConsumerRecordInstant
getTimestamp()
Get the timestamporg.apache.kafka.common.record.TimestampType
getTimestampType()
Get the timestamp typeString
getTopic()
Get the topic
-
-
-
Method Detail
-
getTopic
public String getTopic()
Get the topic- Specified by:
getTopic
in interfaceKafkaMessageMetadata<K>
- Returns:
- the name of the topic
-
getKey
public K getKey()
Get the key- Specified by:
getKey
in interfaceKafkaMessageMetadata<K>
- Returns:
- the key
-
getPartition
public int getPartition()
Get the partition- Specified by:
getPartition
in interfaceKafkaMessageMetadata<K>
- Returns:
- the partition
-
getTimestamp
public Instant getTimestamp()
Get the timestamp- Specified by:
getTimestamp
in 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:
getHeaders
in interfaceKafkaMessageMetadata<K>
- Returns:
- the Kafka headers
-
-