confluent-kafka-python
confluent-kafka-python copied to clipboard
Feature request: Schema with Message in AvroConsumer
Description
Avro message schemas usually carry important information, namespace and name.
For example, in Java API, both specific and generic Avro records have schema available via getSchema.
These namespace and name are essential to be able to:
- differentiate event handling depending on type,
- dynamically create Python objects from deserialized messages.
For those finding this please see @saabeilin's excellent wrapper kafkian.
https://github.com/saabeilin/kafkian/blob/master/README.md
I think in the long run we, confulent-kafka-python, will add two fields(keyObject, valueObject) to the message(In C land) itself which any serializer/deserializer(when alternatives are made available) can leverage. This in theory should make the library more flexible in general for generic serde support but there are still a few things we want to think out first.
I believe this was resolved via https://github.com/confluentinc/confluent-kafka-python/pull/787 which gives Generic Serdes API access for this information