异步发送消息到kafka失败

野心永恒 发表于: 2019-07-31   最后更新时间: 2022-11-28 10:04:32   14,800 游览

我使用异步线程创建producer发送消息到broker,刚开始发送还没有问题,大概10分钟后就出现下面的异常信息

org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
2019-07-31 11:05:39 -Kafka version : 1.0.1
2019-07-31 11:05:47 -Kafka commitId : c0518aa65f25317e
2019-07-31 11:04:39 -该条数据推送kafka异常,icpData:{"createDate":1564541589951,"dataOriginal":"ICP","domain":"121.34.248.210","sourceBody":"NoSuchKey The specified key does not exist. 5D41024E4BF7BB666DF7656E oss-cn-beijing-jdm-d01-a.inner.certyun.cn share_disk/share_disk_3/74/8AFE7CA441010384FBEC9C42FB403D0C","sourceKeywords":"","sourceText":"NoSuchKey The specified key does not exist. 5D41024E4BF7BB666DF7656E oss-cn-beijing-jdm-d01-a.inner.certyun.cn share_disk/share_disk_3/74/8AFE7CA441010384FBEC9C42FB403D0C","syncDate":1564541589951,"updateDate":1564541589951}, 异常为:{}
org.apache.kafka.common.errors.NetworkException: The server disconnected before a response was received.
2019-07-31 11:04:39 -该条数据推送kafka异常,icpData:{"createDate":1564541589949,"dataOriginal":"ICP","domain":"igxite.com.cn","sourceBody":"","sourceKeywords":"","sourceText":"","syncDate":1564541589949,"updateDate":1564541589949}, 异常为:{}
org.apache.kafka.common.errors.NetworkException: The server disconnected before a response was received.
2019-07-31 11:04:39 -该条数据推送kafka异常,icpData:{"createDate":1564541602948,"dataOriginal":"ICP","domain":"tennesseepharma.com","sourceBody":"We're Working Hard...","sourceKeywords":"","sourceText":"Home We're Working Hard...","sourceTitle":"Home","syncDate":1564541602948,"updateDate":1564541602948}, 异常为:{}
org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
2019-07-31 11:07:53 -[Producer clientId=producer-412] Closing the Kafka producer with timeoutMillis = 9223372036854775807 ms.
2019-07-31 11:07:53 -[Producer clientId=producer-411] Closing the Kafka producer with timeoutMillis = 9223372036854775807 ms.
2019-07-31 11:07:43 -该条数据推送kafka异常,icpData:{"createDate":1564541635815,"dataOriginal":"ICP","domain":"cfzbhs.com","sourceBody":"","sourceKeywords":"","sourceText":"","syncDate":1564541635815,"updateDate":1564541635815}, 异常为:{}
org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.
2019-07-31 11:07:53 -[Producer clientId=producer-413] Closing the Kafka producer with timeoutMillis = 9223372036854775807 ms.

大神有遇到过吗?有什么解决方案吗?

发表于 2019-07-31
添加评论

你异步的时,是不是new的线程?

野心永恒 -> 半兽人 5年前

是new的线程

半兽人 -> 野心永恒 5年前

改掉我觉得就好了,你试试。

你的答案

查看kafka相关的其他问题或提一个您自己的问题