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 schema on a topic #250

Open
mt3593 opened this issue May 26, 2020 · 2 comments
Open

Support for multiple schema on a topic #250

mt3593 opened this issue May 26, 2020 · 2 comments

Comments

@mt3593
Copy link

mt3593 commented May 26, 2020

Hi,

We have a requirement to have different types of event on the same topic, this explains the need in great detail: https://www.confluent.io/blog/put-several-event-types-kafka-topic/

The functionality for doing this has been added to the confluent client via this PR confluentinc/schema-registry#680

The current setup for using the avro serde is to provide a single schema. It would be quite nice to provide a list or possibly some configuration of these scheams for a topic.

I'm still working through what this will look like and what the test setup would be as you ideally want to preload all schemas into the mock-schema-registry and redef client to the mock on local test.

Is this something others would consider useful? Is this something jackdaw is planning to support?

@mt3593
Copy link
Author

mt3593 commented May 28, 2020

So to get this to work on the current setup, you need to do something like:

(doto (.serializer (avro/serde schema-url schema false))
    (.configure {"schema.registry.url" schema-url
                        "value.subject.name.strategy" "SubjectNamingStrategy"}
                        false))

Where SubjectNamingStrategy is the fully qualified name of the class that implements getSubjectName as per the interface.

Ideally we should pass on config values into the serailizer rather than having to unpack the serde to set the config after.

@cddr
Copy link
Contributor

cddr commented May 28, 2020

Hey Mark,

Looks like you've been digging into this quite a lot :-) Thanks for your interest. I think there is an arity of the serde constructor which accepts a schema-registry config. It's used in this test helper here.

https://github.com/FundingCircle/jackdaw/blob/master/test/jackdaw/serdes/avro_test.clj#L33

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

2 participants