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

Support non-owned topic schema. #462

Merged
merged 1 commit into from
Jan 21, 2025

Conversation

big-andy-coates
Copy link
Member

fixes: #427
fixes: #452

SpecMesh already allows schema owned by other domains to be referenced by schema owned by the domain. When encountered, such non-owned schema are ignored, i.e. to attempt is made to register them. However, dependent schemas will fail to register if the non-owned schema is not already registered.

What was not supported till now, was a channel directly referencing a non-owned schema. What is called a 'topic schema' in the code. In this instance, the schema needs to be registered against the appropriate ${topic.name}-key or ${topic.name}-value subject, otherwise things won't work.

As the schema isn't owned by the domain, it can't just register the schema. Instead, it first ensures the schema is already registered under a subject name that matches its fully qualified name. For an avro schema the FQ name is ${schema.namespace}.${schema.name}

Only if the non-owned schema has already been registered under the correct name can will the schema also be associated with the topic's key or value by registering the non-owned schema against the appropriate ${topic.name}-key or ${topic.name}-value subject.

fixes: #427
fixes: #452

SpecMesh already allows schema owned by other domains to be referenced by schema owned by the domain.  When encountered, such non-owned schema are ignored, i.e. to attempt is made to register them.  However, dependent schemas will fail to register if the non-owned schema is not already registered.

What was not supported till now, was a channel directly referencing a non-owned schema. What is called a 'topic schema' in the code. In this instance, the schema needs to be registered against the appropriate `${topic.name}-key` or `${topic.name}-value` subject, otherwise things won't work.

As the schema isn't owned by the domain, it can't just register the schema. Instead, it first ensures the schema is already registered under a subject name that matches its fully qualified name. For an avro schema the FQ name is `${schema.namespace}.${schema.name}`

Only if the non-owned schema has already been registered under the correct name can will the schema also be associated with the topic's key or value by registering the non-owned schema against the appropriate `${topic.name}-key` or `${topic.name}-value` subject.
@big-andy-coates big-andy-coates requested a review from a team as a code owner January 16, 2025 17:54
@big-andy-coates big-andy-coates added the enhancement New feature or request label Jan 16, 2025
Copy link
Collaborator

@navery-max navery-max left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice one BAC

@big-andy-coates big-andy-coates merged commit 8154928 into main Jan 21, 2025
3 checks passed
@big-andy-coates big-andy-coates deleted the support-non-owned-topic-schema branch January 21, 2025 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support shared schema as topic schema more than 2 levels of references not working as expected.
2 participants