public static final class OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> extends OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
Constructor and Description |
---|
OutgoingKafkaRecordMetadataBuilder() |
Modifier and Type | Method and Description |
---|---|
OutgoingKafkaRecordMetadata<K> |
build()
Create the
OutgoingKafkaRecordMetadata instance based on the values set in this builder |
OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> |
withHeaders(org.apache.kafka.common.header.Headers headers)
Specify headers for Kafka the timestamp for the Kafka record
|
OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> |
withHeaders(List<org.apache.kafka.common.header.internals.RecordHeader> headers)
Specify the headers for the Kafka record
|
OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> |
withKey(K recordKey)
Set the Kafka record key
|
OutgoingKafkaRecordMetadata.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 record
|
OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> |
withTopic(String topic)
By default the hardcoded topic in the configuration is used.
|
getHeaders, getPartition, getRecordKey, getTimestamp, getTopic
public OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withTopic(String topic)
OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder
withTopic
in class OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
topic
- the topic namepublic OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withKey(K recordKey)
OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder
withKey
in class OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
recordKey
- the keypublic OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withPartition(int partition)
OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder
withPartition
in class OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
partition
- the partition to usepublic OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withTimestamp(Instant timestamp)
OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder
withTimestamp
in class OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
timestamp
- the timestamppublic OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withHeaders(org.apache.kafka.common.header.Headers headers)
OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder
withHeaders
in class OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
headers
- the headerspublic OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K> withHeaders(List<org.apache.kafka.common.header.internals.RecordHeader> headers)
OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder
withHeaders
in class OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
headers
- the headerspublic OutgoingKafkaRecordMetadata<K> build()
OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder
OutgoingKafkaRecordMetadata
instance based on the values set in this builderbuild
in class OutgoingKafkaRecordMetadata.OutgoingKafkaRecordMetadataBuilder<K>
OutgoingKafkaRecordMetadata
instanceCopyright © 2018–2021 SmallRye. All rights reserved.