Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Sending messages to new topics fails #150

Closed
aio-libs/aiokafka
#985
@snaury

Description

@snaury

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions