kafka standalone错误:尝试通过没有打开连接的通道发送响应时发出警告,连接id为0(kafka.network.processor)

axzmvihb  于 2021-06-07  发布在  Kafka
关注(0)|答案(1)|浏览(536)

我在独立服务器上安装kafka,并尝试将数据流传输到mongodb。当启动kafka服务时,bin/kafka-server-start.sh config/server.properties我收到一个警告:警告试图通过没有打开连接的通道发送响应,连接id为0(kafka.network.processor)
尽管如此,在生产者处输入的数据和在消费者处显示的数据并没有问题。
但我认为这会导致数据写入mongodb。启动数据流后,我没有数据写入mongodb。
有人能帮忙解决这个问题吗?非常感谢。

llycmphe

llycmphe1#

//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)
    }

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

相关问题