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

Skip to content

KafkaConsumer always passes message key to deserializer, even if key is None #913

Closed
@jeffwidman

Description

@jeffwidman

I specified json.loads as the KafkaConsumer's key_deserializer callable, then produced a message without a key.

json.loads throws an exception about expecting a string. Looks like root cause is here: https://github.com/dpkp/kafka-python/blob/master/kafka/consumer/fetcher.py#L546

Fetcher is always using passing the key to the deserializer, even if the key is None.

Will submit a PR shortly.

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