在多节点kafka集群上运行此应用程序,并使用0.0.0.0:19092,0.0.0.0:29092,0.0.0.0:39092连接到docker网络。当我启动docker-compose时,它会输出日志Connection to node -3 (/0.0.0.0:39092) could not be established. Broker may not be available
并且在打印一些日志后,生产者开始监听INFO Registered broker 3 at path /brokers/ids/3 with addresses: ArrayBuffer(EndPoint(localhost,39092,ListenerName(PLAINTEXT),PLAINTEXT)) (kafka.zk.KafkaZkClient)
kafka-producer_1_c40d8f3bc06f | 2019-04-28 16:42:43 WARN NetworkClient:1023 - [Producer clientId=producer-1] Error while fetching metadata with correlation id 1 : {topic=LEADER_NOT_AVAILABLE}
并且消费者也打印类似这样的内容
kafka-consumer_1_c9be997eb7fa | 2019-04-28 16:42:44 WARN NetworkClient:1023 - [Consumer clientId=consumer-1, groupId=foo] Error while fetching metadata with correlation id 7 : {topic=LEADER_NOT_AVAILABLE}
kafka-consumer_1_c9be997eb7fa | 2019-04-28 16:33:23 INFO ConsumerCoordinator:290 - [Consumer clientId=consumer-1, groupId=foo] Setting newly assigned partitions: topic-0
kafka-consumer_1_c9be997eb7fa | 2019-04-28 16:33:23 INFO Fetcher:584 - [Consumer clientId=consumer-1, groupId=foo] Resetting offset for partition topic-0 to offset 5.```
but if i start running Proudcer application from IDE it consumes records.
why consumer not consuming in docker network?