Reputation: 3715
Is there a way to create partition key based on hash calculated on an attribute of payload using Spring Boot. There is an interface called Partition
in apache-kafka, but not sure how to allocate the messages into different partitions using Spring boot.
Upvotes: 1
Views: 1756
Reputation: 174564
Set the partitioner.class
producer property to your class name.
partitioner.class
Partitioner class that implements the
org.apache.kafka.clients.producer.Partitioner interface
.default:
org.apache.kafka.clients.producer.internals.DefaultPartitioner
Upvotes: 3