Java报org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server does not host this topic-partition

小蕊 发表于: 2017-10-17   最后更新时间: 2017-10-17 12:48:58   4,263 游览

使用java,我发送消息到kafka,运行了好几天,发现了以下异常

Exception in thread "main" java.util.concurrent.ExecutionException: org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server does not host this topic-partition.
    at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.valueOrError(FutureRecordMetadata.java:65)
    at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(FutureRecordMetadata.java:52)
    at org.apache.kafka.clients.producer.internals.FutureRecordMetadata.get(FutureRecordMetadata.java:25)
    at dummy.DummySyntheticManifestProducer.main(DummySyntheticManifestProducer.java:164)
 Caused by: org.apache.kafka.common.errors.UnknownTopicOrPartitionException: This server does not host this topic-partition.
发表于 2017-10-17

在生产者设置上设置retries属性。 还需要将属性max.in.flight.requests.per.connection设置为1

你的答案

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