-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Add support for Confluent Schema Registry + restructure schema registry extensions #24526
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
6a132e4
to
2e11c97
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Documentation needs to be updated too:
- Avro doc
- Apicurio dev service doc
|
||
// Confluent API compatibility support -- TODO | ||
|
||
reflectiveClass.produce(new ReflectiveClassBuildItem(true, true, false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wondering if we need to add a flag to enable/disable this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typically, guarded with isCcompat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this actually even needed?
Since the IT (native) test worked before I added this ...
I just added this not to forget, and was hoping IT (native) test would expose all the missing stuff ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, that's a good question. What happens if we include in the native image classes that are not available in the classpath. Would that fail? I don't remember... (that's what I'm trying to prevent).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at KafkaProcessor, all these registrations are guarded by try/catch on the CNFE, with a previous try to load a class from the lib it's trying to support.
So maybe this try/catch is missing / needed here as well?
@@ -118,7 +120,21 @@ public void run() { | |||
} | |||
|
|||
private String getRegistryUrlConfig(String baseUrl) { | |||
return baseUrl + "/apis/registry/v2"; | |||
if (isCcompat()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know that ccompat is what is used by apicurio, but maybe let's say: isUsingConfluentCompatibility() (I've found ccompat to be confusing).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I remember we used "Confluent" before in the Apicurio, but then rather went with ccompat
.
I'm OK with your isUsingConfluentCompatibility
.
IMHO, adding support for Confluent Avro serde to the Apicurio Registry Avro serde extension is a wrong way to do this. That way, you will always have both serdes on the classpath (unless the user explicitly excludes the Apicurio Registry Avro serde from the extension dependency, which is hardly idiomatic, because support of that serde library is the main purpose of the extension). What we could/should do is:
|
Ah, true ... yeah, then we need a proper split ...
Why is this - |
I'm not entirely sure if it is possible for extensions to bring dependencies from another Maven repo, perhaps it is. I'm pretty sure we don't really want them to, because of effects on supply chain security and build stability (and downstreams who rebuild Quarkus would also not be particularly pleased I'm sure). But if @gsmet would be fine with it, so would I :-) |
@Ladicek you mean that reflection support in ApicurioRegistryAvroProcessor? Otoh, wrt reflection support in ApicurioRegistryAvroProcessor ... I can see KafkaAvroIT passing for Confluent serde classes, |
Ah ah, now I remember -- we actually register Confluent classes for reflection elsewhere, see |
@Ladicek was there a specific reason for the |
I can't remember one, you just don't use |
BTW this change should also work for confluent kafka protobuf serializer when we add support for protobuf serde. So I think this would be included in |
OK, tests passed ... feedback on the restructure (before I dig into protobuf / json) ? |
Yes the restructuring looks good to me. |
Sorry it took me so long to get to this. The PR is rather complex, so I had to look at it in my IDE. The general idea of the restructuring sounds good to me. As in, to have something like this:
The However, the present PR uses very confusing naming ( I took the liberty to restructure everything once again. The structure I outlined above looks physically like this:
Here's a branch with 1 more commit that restructures everything once more: https://github.com/Ladicek/quarkus/commits/schema-registry-restructured And here's a branch where the 2 commits from previous branch are squashed: https://github.com/Ladicek/quarkus/commits/schema-registry-restructured-squashed One question: the changes in |
@Ladicek yeah, good call and restructuring on the names
Yeah, that one I didn't know where it fits best.
There was an issue with enabled/disabled dev service, which I wasn't able to override from test code. I guess if there are no other issues, we're good to merge? |
Maybe we should consider changing this PRs title and description? |
I moved the service binding thing into Also, I didn't push my changes to this PR. @alesj if you agree with my changes, feel free to update this PR, or I can do that too. |
@Ladicek I think also that Overall I am thinking that we should not need to do this conversion and service binding resource should also contain the mapping for the application. But I am not that deep in service binding to understand if it is possible. |
Sure. |
Yeah, go ahead. |
Pushed and changed PR title. |
Hi @ozangunalp @cescoffier @geoand @iocanel, could you please advise on how to test (manually I guess?) the Apicurio Registry service binding stuff? I don't know who authored that and I have exactly zero experience with service binding, but I figured some of you might know :-) |
No idea about apicurio, but an integration test for service binding for JDBC can be found at: https://github.com/quarkusio/quarkus/tree/2.8.1.Final/integration-tests/kubernetes-service-binding-jdbc I assume something similar can be done for apicurio |
@Ladicek @geoand I don't think that kind of IT will actually test the Apicurio config mapping. It effectively tests that a service binding root directory is transformed to config, but that's it. It seems like those magical keys in I recently did a (manual) test and can confirm that the converter for Apicurio works as intended. |
In that case, I guess I'll just rebase this PR and we can merge it... |
@ozangunalp could you please take a look too? Thanks! |
@Ladicek I am on it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! @Ladicek I also checked that the service binding converter for apicurio still works :)
Thank you! I'm a little scared, but the big green button is so tempting... |
No description provided.