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

RegistryApi.register_schema always talks to Schema Registry when supplied a subject #12

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

ulrikjohansson
Copy link

Fixes #4

Previously, when calling RegistryApi.register_schema(), it short-circuited and directly sent back the schema_id if the schema already existed in the schema_cache, regardless if we supplied a subject/schema combination that didn't previously exist.
This had the effect that the new subject never got created in the Schema Registry, and we didn't have the subject in the subject_cache in RegistryApi either.

This attempts to solve that problem

This is a bit of a hack to be able to specify different
responses for consecutive requests. If we want something
more flexible than this, we should look at integrating something
like "aioresponses" instead
Failed b.c we now make 2 requests in register_schema when using subjects
@jonathansick
Copy link
Member

Sorry we haven't been able to work out this PR. We'll be restarting development on Kafkit this year so I'm at long last taking a look at in issue in #4.

This might be an API design issue in register_schema, because maybe it should never be caching. I noticed that the cache bypass here only works on the subject argument being None, but the subject is only optional because we're using the schema's name if the subject is None. Once I get my head back in this project I'll be more certain of the ideal solution.

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

Successfully merging this pull request may close these issues.

kafkit fails to register schema under new subject if schema_id already exists in cache
2 participants