Skip to content

New AvroDeserializer class requires a reader schema #834

Closed
@mparry

Description

@mparry

Description

The new AvroDeserializer class added in 1.4.0 requires a reader schema but this seems unnecessary and means that it's not possible to use these new classes in the same way as the old AvroConsumer - i.e. in AvroConsumer the default values for reader_key_schema and reader_value_schema are None.

Specifically, we have use cases where we are just interested in consuming (and, say, displaying) whatever messages are forthcoming on a topic and it's sufficient - and indeed preferable - to just use the corresponding writer schema from the registry.

I would be happy to provide a PR addressing this, unless the reader schema requirement is deliberate for some reason.

(A couple of other minor issues I noticed while looking at schema_registry/avro.py: i) the error messages about to_dict not being callable have the arguments the wrong way around; ii) the attempt to raise a ValueError about unrecognized properties will fail; the second call to format() should be join() instead.)

Checklist

Please provide the following information:

  • confluent-kafka-python and librdkafka version (confluent_kafka.version() and confluent_kafka.libversion()): 1.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions