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 classOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>Builder to createOutgoingKafkaRecordMetadatainstances
-
Constructor Summary
Constructors Modifier Constructor Description protectedOutgoingKafkaRecordMetadata(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.OutgoingKafkaRecordMetadataBuilderthat can be used to construct instances ofOutgoingKafkaRecordMetadataorg.apache.kafka.common.header.HeadersgetHeaders()Get the Kafka headersKgetKey()Get the keyintgetPartition()Get the partitionInstantgetTimestamp()Get the timestampStringgetTopic()Get the topic
-
-
-
Method Detail
-
builder
public static <K> OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> builder()
Gets aOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilderthat 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:
getPartitionin interfaceKafkaMessageMetadata<K>- Returns:
- the partition
-
getTimestamp
public Instant getTimestamp()
Get the timestamp- Specified by:
getTimestampin interfaceKafkaMessageMetadata<K>- Returns:
- the timestamp
-
getHeaders
public org.apache.kafka.common.header.Headers getHeaders()
Get the Kafka headers- Specified by:
getHeadersin interfaceKafkaMessageMetadata<K>- Returns:
- the Kafka headers
-
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
-
-