In my application I ran into a problem when Kafka MetadataUpdater tries to get the metadata of a topic that has been manually deleted (using AdminClient).
Because of this, in log I get a lot of messages like [Producer clientId=producer-_] Error while fetching metadata with correlation id 2620 : {deleted_topic_name=UNKNOWN_TOPIC_OR_PARTITION}
I would like to prevent metadata updates for topic that I have deleted. Any suggestions how can I do this?
I should also note that this problem does not occur every time a topic is deleted. In most cases, when I delete a topic, everything works as I expect, and the metadata does not try to be updated. But in any case, sometimes I run into this problem. I would like to avoid this problem altogether.
PS. I use org.apache.kafka:kafka-clients:3.1.2
The only solution I came to is configure topic auto-creation. But obviously this solution is not appropriate for me, because I want topic to be deleted. I just need to prevent metadata updates without any manipulations with topic creation.