javaapache-kafka

ERROR org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment - Error while installing kafka 3.1.0+java11 in windows


I am trying to setup kafka 3.1.0 with java 11 on my local machine. However, while listing existing topics, I am getting timeout exception.

Steps followed:

  1. Started zookeeper server: zookeeper-server-start.bat config\zookeeper.properties

  2. Started kafka server: kafka-server-start.bat config\server.properties

  3. Command to list topics: kafka-topics --bootstrap-server localhost:2181 --list

C:\kafka_2.13-3.1.0>kafka-topics --bootstrap-server localhost:2181 --list Error while executing topic command : Timed out waiting for a node assignment. Call: listTopics [2022-02-19 20:11:37,239] ERROR org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment. Call: listTopics (kafka.admin.TopicCommand$)

Attached stacktrace from command prompt


Solution

  • I resolved this issue. Basically, I enabled listener in server.properties as below,

    listeners=PLAINTEXT://localhost:9092

    Then while running list command changed port number to 9092

    C:\kafka_2.13-3.1.0>kafka-topics --bootstrap-server localhost:9092 --list

    first_topic

    C:\kafka_2.13-3.1.0>