timmy_stapler
timmy_stapler

Reputation: 577

how to produce and consume different avro entities on the same topic?

there has been this article from Martin Kleppmann (on Confluent blog) saying its possible to have different event types into the same kafka topic: Should You Put Several Event Types in the Same Kafka Topic

Here is the related code change request: New (key|value).multi.type option for Avro serialization

The question i have is, how can this be done? How do i define configure a producer and consumer that can process different avro entities to one common topic?

Thanks for your help!

Upvotes: 2

Views: 1218

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191743

The added properties are

key.subject.name.strategy
value.subject.name.strategy

You would use .configure method of the KafkaAvroSerializer to take advantage of these.

I suggest looking at the unit tests because it doesn't seem there is an in-depth documentation section on how to use it.

Upvotes: 2

Related Questions