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>
Contains information the user can set to influence how messages are sent via Kafka.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classBuilder to createOutgoingKafkaRecordMetadatainstances -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedOutgoingKafkaRecordMetadata(String topic, K key, int partition, Instant timestamp, org.apache.kafka.common.header.Headers headers) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Gets aOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilderthat can be used to construct instances ofOutgoingKafkaRecordMetadatafrom(OutgoingKafkaRecordMetadata<K> other) org.apache.kafka.common.header.HeadersGet the Kafka headersgetKey()Get the keyintGet the partitionGet the timestampgetTopic()Get the topic
-
Constructor Details
-
OutgoingKafkaRecordMetadata
-
-
Method Details
-
builder
Gets aOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilderthat can be used to construct instances ofOutgoingKafkaRecordMetadata- Type Parameters:
K- the Kafka record key type- Returns:
- a new builder
-
from
public static <K> OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> from(OutgoingKafkaRecordMetadata<K> other) -
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
-
getHeaders
public org.apache.kafka.common.header.Headers getHeaders()Get the Kafka headers- Specified by:
getHeadersin interfaceKafkaMessageMetadata<K>- Returns:
- the Kafka headers
-
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
-