Handling UNKNOWN_TOPIC_OR_PARTITION

Viewed 106

I am trying to handle the negative testing scenario i.e. Kafka topic is not found. I am setting the Kafka topic wrong purposefully. And I am seeing the below log....

org.apache.kafka.common.errors.TimeoutException: Topic testing.topic.ayan.kafka.topic.v222 not present in metadata after 60000 ms.

I don't the thread to be blocked for 60000 ms. So I have set the "max.block.ms" property to adjust the max block time.

Is there any other way to handle this scenario? Why Kafka core is not handling this on its own?

0 Answers
Related