Kafka 独立错误:警告尝试通过没有打开连接的通道发送响应,连接 id 0 (kafka.network.Processor)

Rob*_*bin 5 connection apache-kafka

我在独立服务器上安装 kafka 并尝试将数据流式传输到 mongodb。当启动 kafka 服务时,bin/kafka-server-start.sh config/server.properties 我有一个警告:警告尝试通过没有打开连接的通道发送响应,连接 id 0 (kafka.network.Processor)

尽管如此,在生产者处输入并在消费者处显示的数据没有问题。

但我认为这会导致数据写入 mongodb。开始数据流后,我没有数据写入 mongodb。

任何人都可以帮助解决这个问题?非常感谢。

mic*_*kof 1

  //processor.sendResponse
  protected[network] def sendResponse(response: RequestChannel.Response) {
    trace(s"Socket server received response to send, registering for write and sending data: $response")
    val channel = selector.channel(response.responseSend.destination)
    // `channel` can be null if the selector closed the connection because it was idle for too long
    if (channel == null) {
      warn(s"Attempting to send response via channel for which there is no open connection, connection id $id")
      response.request.updateRequestMetrics()
    }
    else {
      selector.send(response.responseSend)
      inflightResponses += (response.request.connectionId -> response)
    }
Run Code Online (Sandbox Code Playgroud)

因此,通道被选择器关闭,因为它空闲时间太长