异常信息:
[Consumer clientId=consumer-1, groupId=test] Connection to node -1 could not be established. Broker may not be available.
WARN 10176 --- [ad | producer-1] org.apache.kafka.clients.NetworkClient : [Producer clientId=producer-1] Connection to node -1 could not be established. Broker may not be available.
org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
今天使用springboot整合kafka连接的时候异常
是因为我kafka的config/server.properties文件中配置的是
listeners=PLAINTEXT://localhots:9092
只要将将其修改为listeners=PLAINTEXT://你的ip地址:9092
即可