Description
When using send_messages with a topic name for the first time Kafka automatically creates the topic due to load_metadata_for_topics
, however, metadata request fails because the newly created topic doesn't have a leader yet. Since decode_metadata_response
ignores errors this translates to topic not having partitions and a later KeyError
because topic is not in dictionaries as a result.
Is it possible to somehow handle LeaderNotAvailable
by retrying several times and waiting for election when this happens?
Metadata
Metadata
Assignees
Labels
No labels