Category : kafka-producer-api

I am trying to send String message using Kafka, its throwing Exception with Key of the message being null. But as far as I know the key is automatically assigned by Kafka. I am getting this error in my console. 2021-02-23 14:34:10.420 ERROR 36996 — [ad | producer-1] o.s.k.support.LoggingProducerListener : Exception thrown when sending a ..

Read more

In the windows machine, I have created a Kafka container which is up and running. I am able to post messages on to the Kafka topic by using the below producer java code. public static void main(String[] args) { // Assign topicName to string variable String topicName = "ms-txnclassification-inbox-topic"; // create instance for properties to ..

Read more

In few words, I started Kafka, created succesfully a topic, started a producer with key enabled. So far so good. I send a simple message and I get [email protected]:/# kafka-console-producer –broker-list localhost:9092 –topic testkey –property "parse.key=true" propert y "key.separator=:" >1:fisrtmessage org.apache.kafka.common.KafkaException: No key found on line 1: 1:fisrtmessage at kafka.tools.ConsoleProducer$LineMessageReader.readMessage(ConsoleProducer.scala:275) at kafka.tools.ConsoleProducer$.main(ConsoleProducer.scala:55) at kafka.tools.ConsoleProducer.main(ConsoleProducer.scala) [email protected]:/# ..

Read more

I am runnung the kafka containers and i am getting the error as: 06:11:49.861 [kafka-producer-network-thread | producer-1] WARN o.apache.kafka.clients.NetworkClient – [Producer clientId=producer-1] Error while fetching metadata with correlation id 800 : {test-topic=LEADER_NOT_AVAILABLE} Following are the commands that i have run: -e ZOOKEEPER_CLIENT_PORT=2181 -p 2181:2181 confluentinc/cp-zookeeper:5.3.1 zookeeper_host=$(sudo docker inspect zookeeper | jq -r .[].NetworkSettings.Networks.bridge.IPAddress) && echo ..

Read more

I installed zookeeper and kafka docker container on virtual machine. MY settings look like zookeeper: image: confluentinc/cp-zookeeper:latest name:zookeeper ZOOKEEPER_CLIENT_PORT: 2181 ports: – “2181:2181” kafka: image: confluentinc/cp-kafka:latest hostname: kafka KAFKA_BROKER_ID: “-1” KAFKA_ZOOKEEPER_CONNECT: “zookeeper:2181”); ALLOW_PLAINTEXT_LISTENER: “yes” KAFKA_LISTENERS: “PLAINTEXT://9092, PLAINTEXT_HOST://29092” KAFKA_ADVERTISED_LISTENERS: “PLAINTEXT://kafka:9092, PLAINTEXT_HOST://localhost:29092” KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: “PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT” KAFKA_INTER_BROKER_LISTENER_NAME: “PLAINTEXT” KAFKA_DEFAULT_REPLICATION_FACTOR: “1” AUTO.LEADER.REBALANCE.ENABLE: “true” KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE: “true” KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: “1” Now i am ..

Read more

I have two tomcat with a webapp. I run kafka and zookeeper service with docker, and i run tomcats. In kafka console i see that are created 2 consumer at second with this message: kafka_1 | [2019-12-20 16:30:20,725] INFO [GroupCoordinator 1001]: Stabilized group 1001 generation 12902 (__consumer_offsets-24) (kafka.coordinator.group.GroupCoordinator) kafka_1 | [2019-12-20 16:30:20,730] INFO [GroupCoordinator 1001]: ..

Read more