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>
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
ConstructorsConstructorDescriptionIncomingKafkaRecordMetadata(org.apache.kafka.clients.consumer.ConsumerRecord<K, T> record, String channel) IncomingKafkaRecordMetadata(org.apache.kafka.clients.consumer.ConsumerRecord<K, T> record, String channel, int index, int consumerGroupGenerationId) Constructor -
Method Summary
Modifier and TypeMethodDescriptionintintorg.apache.kafka.common.header.HeadersGet the Kafka headersgetKey()Get the keylongGet the offsetintGet the partitionGet the underlying Kafka ConsumerRecordGet the timestamporg.apache.kafka.common.record.TimestampTypeGet the timestamp typegetTopic()Get the topic
-
Constructor Details
-
Method Details
-
getTopic
Get the topic- Specified by:
getTopicin interfaceKafkaMessageMetadata<K>- Returns:
- the name of the topic
-
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
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
-
getRecord
Get the underlying Kafka ConsumerRecord- Returns:
- the underlying Kafka ConsumerRecord
-
getChannel
-
getConsumerIndex
public int getConsumerIndex() -
getConsumerGroupGenerationId
public int getConsumerGroupGenerationId()- Returns:
- the consumer group metadata generation id at the time of polling this record
-