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 theOutgoingKafkaRecordMetadata
instance 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.OutgoingKafkaRecordMetadataBuilder
By 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:
withTopic
in classOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
- Parameters:
topic
- the topic name- Returns:
- this builder
-
withKey
public OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withKey(K recordKey)
Description copied from class:OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder
Set the Kafka record key- Overrides:
withKey
in classOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
- Parameters:
recordKey
- the key- Returns:
- this builder
-
withPartition
public OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withPartition(int partition)
Description copied from class:OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder
In 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:
withPartition
in 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.OutgoingKafkaRecordMetadataBuilder
Specify the timestamp for the Kafka record- Overrides:
withTimestamp
in 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.OutgoingKafkaRecordMetadataBuilder
Specify headers for Kafka the timestamp for the Kafka record- Overrides:
withHeaders
in 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.OutgoingKafkaRecordMetadataBuilder
Specify the headers for the Kafka record- Overrides:
withHeaders
in classOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
- Parameters:
headers
- the headers- Returns:
- this builder
-
build
public OutgoingKafkaRecordMetadata<K> build()
Description copied from class:OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder
Create theOutgoingKafkaRecordMetadata
instance based on the values set in this builder- Overrides:
build
in classOutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
- Returns:
- a new
OutgoingKafkaRecordMetadata
instance
-
-