confluent-schema-registry
confluent-schema-registry copied to clipboard
Is there support for specifying Subject Name Strategy like TopicNameStrategy, RecordNameStrategy, TopicRecordNameStrategy?
In Java, we can specify properties like value.subject.name.strategy, key.subject.name.strategy for producer configuration with respect to schema registration, with values like TopicNameStrategy, RecordNameStrategy, TopicRecordNameStrategy. Does this library support this feature?
https://docs.confluent.io/current/schema-registry/serdes-develop/index.html
| Strategy | Description |
|---|---|
| TopicNameStrategy | Derives subject name from topic name. (This is the default.) |
| RecordNameStrategy | Derives subject name from record name, and provides a way to group logically related events that may have different data structures under a subject. |
| TopicRecordNameStrategy | Derives the subject name from topic and record name, as a way to group logically related events that may have different data structures under a subject. |
I see RecordNameStrategy is being used a default strategy with this library.
Would be nice to have since we use a custom naming strategy
This client assumes RecordNameStrategy. You can override that by specifying subject in the options argument when registering a schema. Java and .NET clients use TopicNameStrategy by default. And the Confluent Control Center also assumes TopicNameStrategy in its UI (when you browse a given topic, the "schema" pages only list schemas if you're using that strategy).
It might be worth revising the official docs to underline the fact that this client assumes RecordNameStrategy by default, differing from how other clients behave (the docs already mentions what the default is, but doesn't point out how this differs from other clients). That could help guide developers in polyglot environments (and if you're using Kafka, there's a good chance you work for a large company and if it's a large company there's a good chance your devs are not all using JS clients) so they don't assume that using this client's defaults will play nice with Java/.NET/other clients' defaults.