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

Apicurio/confluent compatibility issues #1874

Closed
janvyhnanek opened this issue Sep 24, 2021 · 8 comments
Closed

Apicurio/confluent compatibility issues #1874

janvyhnanek opened this issue Sep 24, 2021 · 8 comments
Labels
type/question Further information is requested

Comments

@janvyhnanek
Copy link

I have a question about compatibility between apicurio and confluent ser/des clients.

If an application is written in C# it has to use confluent client since apicurio does not provide such feature. It is possible to make it working with producer on apicurio if producer sets properties apicurio.registry.as-confluent=true, apicurio.registry.use-id=contentId and apicurio.registry.headers.enabled=false. But as a consequence all other consumers with apicurio clients must set parameters apicurio.registry.use-id=contentId, apicurio.registry.as-confluent=true which will ensure usage of Legacy4ByteIdHandler. Also, serialization with confluent client requires schema registered with default groupId as mentioned in #1593.

In my comprehension, if there is even one application which cannot use apicurio clients, all other applications have to conform to confluent standards marked as legacy in apicurio to make it working. Am I right or is there any option to use non legacy ids in this case? It seems that because of one application writen in C# we will have to use only default groupId and legacy id handling everywhere.

Thank you

@EricWittmann EricWittmann added the type/question Further information is requested label Sep 24, 2021
@EricWittmann
Copy link
Member

I think you are exactly right unless you are willing to write your own custom SerDes in C#. Certainly it would be great if we had the bandwidth to implement C# and Python SerDes. That's the situation right now at least. Some issues could be resolved perhaps with a proxy between the confluent client and the registry, where the proxy could utilize the registry API instead of the ccompat API and e.g. add group info.

@EricWittmann
Copy link
Member

Other ideas @Apicurio/developers ?

@janvyhnanek
Copy link
Author

Thanks for information, it seems that indeed we will have to switch to confluent mode of communication, it is not in our capacity either to create clients for other languages in apicurio mode now.

We have found another problem related to missing groupId in confluent - if we switch to confluent mode, groupId must be always default. However, we still want the possibility to differ between schemas by namespaces. Confluent client works fine, if groupId is registered as null and namespace is specified directly in artifactId (e.g. artifactId=io.test.SchemaName), but apicurio strategy RecordIdStrategy does not work on such schema, because the unqualified name of record is used for schema lookup. GroupId can be switched to default by configuration apicurio.registry.artifact.group-id="default", but I have found no option to make artifactId qualified. Is the right approach to implement our own strategy "QualifiedRecordIdStrategy" where the only difference would getting artifactId by schema.getFullName() instead of schema.getName()? Maybe it would be useful, if you add such configuration for the current strategies?

Thank you

@famarting
Copy link
Contributor

Hi, yes it's a perfectly fine approach to implement your own strategy "QualifiedRecordIdStrategy" we had the strategy interface for that purpose.

JFYI Also there is another interface SchemaResolver that it's also acceptable to re-implement, that may help you in the future if you find a very specific usecase, just have in mind doing so is a very advanced usecase :)

@EricWittmann
Copy link
Member

Note to @janvyhnanek - we would welcome a contribution of the QualifiedRecordIdStrategy if you ended up creating it!

@janvyhnanek
Copy link
Author

@EricWittmann I have created and tested the class but I have troubles creating a feature branch for pull request, I get an authorization error. Could you grant me the necessary rights or how else should I proceed? Thank you

@famarting
Copy link
Contributor

Hi @janvyhnanek you have to create your pull request from your fork of the repository.

@EricWittmann
Copy link
Member

Yes @famartinrh is correct - please create a fork of the repository, then push the feature branch to your fork and submit the PR from that. And thank you in advance for the contribution!

janvyhnanek pushed a commit to janvyhnanek/apicurio-registry that referenced this issue Nov 12, 2021
famarting pushed a commit that referenced this issue Nov 19, 2021
* Qualified record id strategy - strategy for records with namespace in artifactId (#1874)

* add unit test

Co-authored-by: Jan Vyhnanek <jan_vyhnanek@kb.cz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants