confluent-kafka-python icon indicating copy to clipboard operation
confluent-kafka-python copied to clipboard

Feature request: Schema with Message in AvroConsumer

Open saabeilin opened this issue 7 years ago • 1 comments

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.

saabeilin avatar Sep 19 '18 07:09 saabeilin

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.

rnpridgeon avatar Oct 15 '18 13:10 rnpridgeon

I believe this was resolved via https://github.com/confluentinc/confluent-kafka-python/pull/787 which gives Generic Serdes API access for this information

MSeal avatar Jun 24 '25 23:06 MSeal