I’d like to extend Kafka DefaultPartitioner to make a custom one. However, I find no way to access the message headers as the partitioning should be based on a value present there. EDIT 1: The task is choosing a partition not based on the key but on another integer contained in the header. Answer You cannot access headers in custom
Advertisement
Tag: kafka-producer-api
kafka producer does not throw exception when broker is down
Created a cluster with two brokers using same zookeeper and trying to produce message to a topic whose details are as below. When the producer sets acks=”all” or -1,min.insync.replicas=”2″, it is supposed to receive acknowledgement from the brokers(leaders and replicas) but when one broker is shut manually while it is producing, it is making no difference to the kafka producer
I’m getting “Topic not present in metadata after 60000 ms” message on some computers
Here’s my program package kafkaConsumer; import org.apache.kafka.clients.consumer.*; import org.apache.kafka.clients.producer.*; import org.apache.kafka.common.serialization.LongSerializer; import …
SpringBoot, Kafka : java.lang.NoSuchMethodError: org.apache.kafka.clients.producer.Producer.close(Ljava/time/Duration;)V
I’m using spring boot v2.2.4 and Apache Kafka in my project. Below is my pom.xml file: org.springframework.boot</groupId&…
Advertisement