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

ReferenceSubjectNameStrategy is missing option for QualifiedReferenceSubjectNameStrategy #2218

Open
1 of 8 tasks
mattstermiller opened this issue May 8, 2024 · 0 comments

Comments

@mattstermiller
Copy link

Description

The ReferenceSubjectNameStrategy enum only defines the default "ReferenceName" and does not define the alternate "Qualified" strategy described in this Schema Registry documentation. The implementation of the ProtobufSerializer also keeps the reference subject naming completely closed to outside extension with no way to override this behavior.

Motivation

We are running into an issue where we have two completely different proto packages with files that have the same relative path that are imported into protos used for schemas.

For Example:

  • DomainA/events/ModelA.proto:

    import "shared/Enums.proto";
    // ...
  • DomainA/shared/Enums.proto:

    package domain_a;
    enum ItemTypes { }
  • DomainB/events/ModelB.proto:

    import "shared/Enums.proto";
    // ...
  • DomainB/shared/Enums.proto:

    package domain_b;
    enum ThingTypes { }

Since the reference subject name strategy does not take the package name of the imported proto into account, we have a conflict where our clients are trying to register these different schemas under the same name and we get this error:

Confluent.SchemaRegistry.SchemaRegistryException: Schema being registered is incompatible with an earlier schema for subject "shared/Enums.proto", details: [{errorType:"PACKAGE_CHANGED", description:"The package at '#/' in the old schema does not match the package in the new schema"}

We want to use the package name as part of the subject name to avoid having to ensure that all of our imported proto file names are unique across our organization.

How to reproduce

N/A

Checklist

Please provide the following information:

  • A complete (i.e. we can run it), minimal program demonstrating the problem. No need to supply a project file.
  • Confluent.Kafka nuget version. 2.4.0
  • Apache Kafka version. N/A
  • Client configuration. N/A
  • Operating system. N/A
  • Provide logs (with "debug" : "..." as necessary in configuration). N/A
  • Provide broker log excerpts. N/A
  • Critical issue.
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

1 participant