public class PartitionKeyExtensionInterceptor extends Object implements org.apache.kafka.clients.producer.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(org.apache.kafka.clients.producer.RecordMetadata metadata,
Exception exception) |
org.apache.kafka.clients.producer.ProducerRecord<Object,io.cloudevents.CloudEvent> |
onSend(org.apache.kafka.clients.producer.ProducerRecord<Object,io.cloudevents.CloudEvent> record) |
public static final String PARTITION_KEY_EXTENSION
public org.apache.kafka.clients.producer.ProducerRecord<Object,io.cloudevents.CloudEvent> onSend(org.apache.kafka.clients.producer.ProducerRecord<Object,io.cloudevents.CloudEvent> record)
onSend in interface org.apache.kafka.clients.producer.ProducerInterceptor<Object,io.cloudevents.CloudEvent>public void onAcknowledgement(org.apache.kafka.clients.producer.RecordMetadata metadata,
Exception exception)
onAcknowledgement in interface org.apache.kafka.clients.producer.ProducerInterceptor<Object,io.cloudevents.CloudEvent>public void close()
close in interface org.apache.kafka.clients.producer.ProducerInterceptor<Object,io.cloudevents.CloudEvent>Copyright © 2024. All rights reserved.