简体   繁体   中英

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

Using java I am sending a json object to kafka, initially it worked for me for 2 days, now I am getting the following exception

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.

setting the retries property on the producer settings. also need to set the property max.in.flight.requests.per.connection to 1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM