confluentinc / confluent-kafka-dotnet

Confluent's Apache Kafka .NET client
https://github.com/confluentinc/confluent-kafka-dotnet/wiki
Apache License 2.0
2.78k stars 847 forks source link

Query Regarding Custom Subject Naming Strategy with Confluent.SchemaRegistry #2153

Open JoaBjo opened 6 months ago

JoaBjo commented 6 months ago

Hello,

I am reaching out to seek guidance on a specific use case involving Confluent.SchemaRegistry.Serdes.Avro and Confluent.SchemaRegistry. Our organization currently utilizes a custom schema registry client that follows a unique naming convention for topics and their corresponding subjects in the schema registry. Specifically, topics can be named using a prefix and topic format (_), which are then mapped to subjects in the schema registry as -value (or -key).

So for instance, topics like AAA_MyTopic, BBB_MyTopic, and CCC_MyTopic all use the same subject in the schema registry. In hindsight, a record naming strategy might have been more suitable, but I'm exploring ways to integrate with the existing setup.

Given this background, I have a few questions:

Is there a way to leverage the Confluent.SchemaRegistry in such a scenario where a custom topic-to-subject mapping exists?

Would it make sense to have a more fliexible configuration the serializer/schema registry. So that instead of just providing the SubjectNameStrategy enum in the serializer config you could somehow provide the SubjectNameStrategyDelegate? Then you would have complete flexibility in using any custom subject naming conventions.

I appreciate any insights or recommendations you could provide regarding this matter. Thank you for your time and assistance.