I wanted to setup Kafka Rest proxy but ran into a problem. I have my kafka and zookeeper server running locally at localhost:9092 but when I am trying to setup my Kafka rest proxy using docker but the issue is when I am trying to start the container I am not able to start the rest proxy and I am running into the error which says Node disconnected ( broker may not be available).
rest-proxy | [2023-07-11 10:45:51,575] ERROR Error while getting broker list. (io.confluent.admin.utils.ClusterStatus)
rest-proxy | java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment. Call: listNodes
rest-proxy | at java.base/java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:395)
rest-proxy | at java.base/java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1999)
rest-proxy | at org.apache.kafka.common.internals.KafkaFutureImpl.get(KafkaFutureImpl.java:165)
rest-proxy | at io.confluent.admin.utils.ClusterStatus.isKafkaReady(ClusterStatus.java:147)
rest-proxy | at io.confluent.admin.utils.cli.KafkaReadyCommand.main(KafkaReadyCommand.java:149)
rest-proxy | Caused by: org.apache.kafka.common.errors.TimeoutException: Timed out waiting for a node assignment. Call: listNodes
rest-proxy | [2023-07-11 07:32:45,557] INFO [AdminClient clientId=adminclient-1] Node 0 disconnected. (org.apache.kafka.clients.NetworkClient)
rest-proxy | [2023-07-11 07:32:45,558] WARN [AdminClient clientId=adminclient-1] Connection to node 0 (*virtualbox/127.0.1.1:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
But the Kafka Server is running because when I run
./bin/kafka-topics.sh --bootstrap-server localhost:9092 --list
I do receive the list of topics
I am using docker for rest proxy and this is my compose file
version: '2'
services:
rest-proxy:
image: confluentinc/cp-kafka-rest:7.3.0
ports:
- 8082:8082
hostname: rest-proxy
container_name: rest-proxy
environment:
KAFKA_REST_HOST_NAME: rest-proxy
KAFKA_REST_LISTENERS: "http://0.0.0.0:8082"
KAFKA_REST_BOOTSTRAP_SERVERS: "host.docker.internal:9092"
extra_hosts:
- "host.docker.internal:host-gateway"
Any help regarding this is appreciated.