使用 Spring Boot 自定义 kafka 主题分区

Custom partition of kafka topics using Spring Boot

有没有办法使用 Spring Boot.在 apache-kafka 中有一个名为 Partition 的接口,但不确定如何使用 Spring 引导将消息分配到不同的分区中。

the kafka documentation

partitioner.class 生产者 属性 设置为您的 class 名称。

partitioner.class

Partitioner class that implements the org.apache.kafka.clients.producer.Partitioner interface.

default:org.apache.kafka.clients.producer.internals.DefaultPartitioner