Skip to content

DeserializingConsumer does not return a regular Message when used with AvroDeserializer #1800

Open
@InterferencePattern

Description

@InterferencePattern

Description

The Message object returned by DeserializingConsumer.value() doesn't appear to match the signature- it can return a dict, for example, and not only a str or bytes.

How to reproduce

  1. Use AvroDeserializer to create DeserializingConsumer
  2. Use .poll() method to return message
  3. Message.value() should contain deserialized dictionary instead of str or bytes

I wonder if the DeserializingConsumer needs a DeserializedMessage, with something like the following:

class DeserializedMessage(Message):
    def value(self, payload=None) -> dict:
        return super().value(payload)

Checklist

Please provide the following information:

  • confluent-kafka-python and librdkafka version (confluent_kafka.version() and confluent_kafka.libversion()): ('2.3.0', 33751040), ('2.3.0', 33751295)
  • Apache Kafka broker version:
  • Client configuration: {...}
  • Operating system:
  • Provide client logs (with 'debug': '..' as necessary)
  • Provide broker log excerpts
  • Critical issue

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions