Skip to main content

Setting kafka headers in ProducerRecord

Hi All,

I need to use Kafka header in the ProducerRecord, however I see the
constructor to provide headers also need to mention the partition number. I
don't want the records to be distributed to available partitions based on
kafka's default mechanism and don't want to specify the partition by
myself. What is the option to provide headers without specifying the
partition?

Comments