Skip to content

AvroConsumer — access to key & value schemas #289

Open
@rcoup

Description

@rcoup

Description

AvroConsumer happily returns decoded Avro messages, but drops all reference to the original Avro schema/identifier. The schema is super-useful in some cases (eg. Debezium, where it contains the source database table schema).

One (relatively straightforward) solution is to:

  1. update avro.MessageSerializer.decode_message() to return a (schema_id, payload) tuple
  2. have AvroConsumer.poll() wrap the Message in a Python AvroMessage subclass which has additional .key_schema_id and .value_schema_id attributes. Could also do this in C.
  3. expose the schema registry client via a AvroConsumer.get_schema(schema_id) method

Checklist

Please provide the following information:

  • confluent-kafka-python and librdkafka version (confluent_kafka.version() and confluent_kafka.libversion()): 0.11.0
  • 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

    Labels

    component:schema-registryAny schema registry related isues rather than kafka isolated onesenhancementRequesting a feature changepriority:highMaintainer triage tag for indicating high impact or criticality issuesstatus:help-wantedIssues that would especially appreciate external development or attention

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions