public class PartitionKeyExtensionInterceptor extends Object implements ProducerInterceptor<Object,io.cloudevents.CloudEvent>
ProducerInterceptor implements the partitioning extension,
as described in the CloudEvents Kafka specification.
When using in your KafkaProducer,
it will pick the partitionkey extension from the event and will set it as record key.
If the extension is missing, It won't replace the key from the original record.
| Modifier and Type | Field and Description |
|---|---|
static String |
PARTITION_KEY_EXTENSION
The extension key of partition key extension.
|
| Constructor and Description |
|---|
PartitionKeyExtensionInterceptor() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
void |
configure(Map<String,?> configs) |
void |
onAcknowledgement(RecordMetadata metadata,
Exception exception) |
ProducerRecord<Object,io.cloudevents.CloudEvent> |
onSend(ProducerRecord<Object,io.cloudevents.CloudEvent> record) |
public static final String PARTITION_KEY_EXTENSION
public ProducerRecord<Object,io.cloudevents.CloudEvent> onSend(ProducerRecord<Object,io.cloudevents.CloudEvent> record)
onSend in interface ProducerInterceptor<Object,io.cloudevents.CloudEvent>public void onAcknowledgement(RecordMetadata metadata, Exception exception)
onAcknowledgement in interface ProducerInterceptor<Object,io.cloudevents.CloudEvent>public void close()
close in interface ProducerInterceptor<Object,io.cloudevents.CloudEvent>public void configure(Map<String,?> configs)
configure in interface ConfigurableCopyright © 2021. All rights reserved.