Currently Confluent Kafka dotnet supports three subject name strategy:
- Topic Name
- Record type
- TopicRecord type
I want to create a custom subject strategy where I can generate subject & schema with custom values. For example,
Subject : env.RecordTypeFullName
Please suggest
As you've seen, there are none with "env" prefix. Since the values are an enum, there is no easy way to override this, and it will instead throw an exception.
https://github.com/confluentinc/confluent-kafka-dotnet/blob/master/src/Confluent.SchemaRegistry/SubjectNameStrategy.cs#L97
IMO, it is an anti-pattern to include an "env" prefix in your schemas since dev/test/stage should all be as close to "prod" as possible. Your registry server running in "non-prod" might have the env encoded in the URL, instead, but your schema name shouldn't. The topic name (i.e. subject name) could. Then you'd use the TopicName / TopicRecord Strategy