Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for multiple schemas in one topic #477

Open
7 tasks
golfpreben opened this issue Nov 2, 2018 · 6 comments
Open
7 tasks

Support for multiple schemas in one topic #477

golfpreben opened this issue Nov 2, 2018 · 6 comments

Comments

@golfpreben
Copy link

golfpreben commented Nov 2, 2018

Description

Support for multiple schemas in one topic for JAVA avro serializer was added in pull request:
https://github.com/confluentinc/schema-registry/pull/680
Any chance this could be supported from python too?

How to reproduce

In tried to add value.subject.name.strategy to the config of the avro producer

avroProducer = AvroProducer({
'bootstrap.servers': '127.0.0.1:9092',
'schema.registry.url': 'http://127.0.0.1:8081',
'value.subject.name.strategy': 'io.confluent.kafka.serializers.subject.TopicNameStrategy'
}, default_key_schema=key_schema, default_value_schema=value_schema)

and got the following errror:

cimpl.KafkaException: KafkaError{code=_INVALID_ARG,val=-186,str="No such configuration property: "value.subject.name.strategy""}

Checklist

Please provide the following information:

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

OneCricketeer commented Dec 5, 2018

See #442 & #401

@cschaible
Copy link

Are there any news regarding this issue? Both referenced issues (#442, #401) are closed. The issue #401 references #502, where nothing happens since months. As written in #560 the issue #502 might be included in the next release but (when) will this happen? Maybe @mhowlett can provide information, since he's reviewing the pull-request #502. Thanks in advance!

@enima2684
Copy link

Is there any workaround we can use while waiting for the new release ?
Many thanks

@mhowlett
Copy link
Contributor

AvroProducer is being replaced by the new avro serdes which support naming strategies: https://github.com/confluentinc/confluent-kafka-python/blob/master/confluent_kafka/schema_registry/avro.py

we don't yet support this: https://www.confluent.io/blog/multiple-event-types-in-the-same-kafka-topic/

@enima2684
Copy link

enima2684 commented Jul 17, 2020

Thanks for the quick reply and good to know this functionality is already implemented.

However, it is not yet clear for me where/how to enter this configuration parameter ?

For the moment, I create a Producer object as follows :

        producer = AvroProducer(
            {
              'bootstrap.servers': "myBootstrapServers",
              'schema.registry.url': "mySchemaRegistryUrl",
              'enable.idempotence': 'true'
            },
            default_key_schema=self.get_key_schema(),
            default_value_schema=self.get_value_schema()     
 )

Is it something to add in the producer config ?

@amineouba
Copy link

did you find a solution ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants