Class OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
- java.lang.Object
-
- io.smallrye.reactive.messaging.kafka.api.OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
-
- io.smallrye.reactive.messaging.kafka.OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
-
- Enclosing class:
- OutgoingKafkaRecordMetadata<K>
public static final class OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> extends OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
-
-
Constructor Summary
Constructors Constructor Description OutgoingKafkaRecordMetadataBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OutgoingKafkaRecordMetadata<K>build()Create theOutgoingKafkaRecordMetadatainstance based on the values set in this builderOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>withHeaders(List<org.apache.kafka.common.header.internals.RecordHeader> headers)Specify the headers for the Kafka recordOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>withHeaders(org.apache.kafka.common.header.Headers headers)Specify headers for Kafka the timestamp for the Kafka recordOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>withKey(K recordKey)Set the Kafka record keyOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>withPartition(int partition)In most cases Kafka's partitioner should be used to chose the Kafka partition.OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>withTimestamp(Instant timestamp)Specify the timestamp for the Kafka recordOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>withTopic(String topic)By default the hardcoded topic in the configuration is used.-
Methods inherited from class io.smallrye.reactive.messaging.kafka.api.OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder
getHeaders, getPartition, getRecordKey, getTimestamp, getTopic
-
-
-
-
Method Detail
-
withTopic
public OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withTopic(String topic)
Description copied from class:OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilderBy default the hardcoded topic in the configuration is used. If decisions need to be made dynamically about which topic to use, it may be specified here.- Overrides:
withTopicin classOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>- Parameters:
topic- the topic name- Returns:
- this builder
-
withKey
public OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withKey(K recordKey)
Description copied from class:OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilderSet the Kafka record key- Overrides:
withKeyin classOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>- Parameters:
recordKey- the key- Returns:
- this builder
-
withPartition
public OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withPartition(int partition)
Description copied from class:OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilderIn most cases Kafka's partitioner should be used to chose the Kafka partition. Im cases where that is not suitable, it may be specified here.- Overrides:
withPartitionin classOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>- Parameters:
partition- the partition to use- Returns:
- this builder
-
withTimestamp
public OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withTimestamp(Instant timestamp)
Description copied from class:OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilderSpecify the timestamp for the Kafka record- Overrides:
withTimestampin classOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>- Parameters:
timestamp- the timestamp- Returns:
- this builder
-
withHeaders
public OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withHeaders(org.apache.kafka.common.header.Headers headers)
Description copied from class:OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilderSpecify headers for Kafka the timestamp for the Kafka record- Overrides:
withHeadersin classOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>- Parameters:
headers- the headers- Returns:
- this builder
-
withHeaders
public OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withHeaders(List<org.apache.kafka.common.header.internals.RecordHeader> headers)
Description copied from class:OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilderSpecify the headers for the Kafka record- Overrides:
withHeadersin classOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>- Parameters:
headers- the headers- Returns:
- this builder
-
build
public OutgoingKafkaRecordMetadata<K> build()
Description copied from class:OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilderCreate theOutgoingKafkaRecordMetadatainstance based on the values set in this builder- Overrides:
buildin classOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>- Returns:
- a new
OutgoingKafkaRecordMetadatainstance
-
-