你好,我单独写了支持消费和生产消息的jar包。单独运行这个jar,可以正常产生消息和消费消息。当将这个jar被依赖到另一个项目,便不停出现这样的问题。
2018-10-19 14:32:27.087 [restartedMain] DEBUG org.apache.kafka.clients.NetworkClient - Node -1 disconnected.
2018-10-19 14:32:27.087 [restartedMain] WARN org.apache.kafka.clients.NetworkClient - Bootstrap broker 120.77.254.103:3811 disconnected
2018-10-19 14:32:27.087 [restartedMain] DEBUG org.apache.kafka.clients.NetworkClient - Give up sending metadata request since no node is available
2018-10-19 14:32:27.188 [restartedMain] DEBUG org.apache.kafka.clients.NetworkClient - Initialize connection to node -1 for sending metadata request
2018-10-19 14:32:27.188 [restartedMain] DEBUG org.apache.kafka.clients.NetworkClient - Initiating connection to node -1 at 120.77.254.103:3811.
2018-10-19 14:32:27.196 [restartedMain] DEBUG org.apache.kafka.common.network.Selector - Created socket with SO_RCVBUF = 65536, SO_SNDBUF = 131072, SO_TIMEOUT = 0 to node -1
2018-10-19 14:32:27.196 [restartedMain] DEBUG org.apache.kafka.clients.NetworkClient - Completed connection to node -1
2018-10-19 14:32:27.289 [restartedMain] DEBUG org.apache.kafka.clients.NetworkClient - Sending metadata request {topics=[trade-topic]} to node -1
2018-10-19 14:32:27.297 [restartedMain] DEBUG org.apache.kafka.common.network.Selector - Connection with /120.77.254.103 disconnected
由上先是断开于node-1的连接,后又开始发送请求连接node-1,完成连接后。开始请求主题trade-topic的消息,现在这个topic一直有新消息在发送。后有不知道什么情况又断开连接,然后开始打印下面的错误
java.io.EOFException: null
at org.apache.kafka.common.network.NetworkReceive.readFromReadableChannel(NetworkReceive.java:83)
at org.apache.kafka.common.network.NetworkReceive.readFrom(NetworkReceive.java:71)
at org.apache.kafka.common.network.KafkaChannel.receive(KafkaChannel.java:154)
at org.apache.kafka.common.network.KafkaChannel.read(KafkaChannel.java:135)
at org.apache.kafka.common.network.Selector.pollSelectionKeys(Selector.java:343)
at org.apache.kafka.common.network.Selector.poll(Selector.java:291)
at org.apache.kafka.clients.NetworkClient.poll(NetworkClient.java:260)
at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:232)
at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:209)
后台一直不停的重复打印。