Class OutgoingKafkaRecordMetadata<K>
- java.lang.Object
-
- io.smallrye.reactive.messaging.kafka.api.OutgoingKafkaRecordMetadata<K>
-
- Type Parameters:
K
- The Kafka record key type
- All Implemented Interfaces:
KafkaMessageMetadata<K>
- Direct Known Subclasses:
OutgoingKafkaRecordMetadata
public class OutgoingKafkaRecordMetadata<K> extends Object implements KafkaMessageMetadata<K>
Contains information the user can set to influence how messages are sent via Kafka.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
Builder to createOutgoingKafkaRecordMetadata
instances
-
Constructor Summary
Constructors Modifier Constructor Description protected
OutgoingKafkaRecordMetadata(String topic, K key, int partition, Instant timestamp, org.apache.kafka.common.header.Headers headers)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <K> OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
builder()
Gets aOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder
that can be used to construct instances ofOutgoingKafkaRecordMetadata
org.apache.kafka.common.header.Headers
getHeaders()
Get the Kafka headersK
getKey()
Get the keyint
getPartition()
Get the partitionInstant
getTimestamp()
Get the timestampString
getTopic()
Get the topic
-
-
-
Method Detail
-
builder
public static <K> OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> builder()
Gets aOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder
that can be used to construct instances ofOutgoingKafkaRecordMetadata
- Type Parameters:
K
- the Kafka record key type- Returns:
- a new builder
-
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
-
getHeaders
public org.apache.kafka.common.header.Headers getHeaders()
Get the Kafka headers- Specified by:
getHeaders
in interfaceKafkaMessageMetadata<K>
- Returns:
- the Kafka headers
-
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
-
-