-
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
Rest Client Reactive - fixed @RegisterProvider support #16757
Rest Client Reactive - fixed @RegisterProvider support #16757
Conversation
383dac9
to
ce75636
Compare
👍🏼 I'll check it out on Monday |
...nt/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java
Outdated
Show resolved
Hide resolved
...nt/src/main/java/io/quarkus/rest/client/reactive/deployment/RestClientReactiveProcessor.java
Outdated
Show resolved
Hide resolved
* @param generatedBeans build producer for generated beans | ||
*/ | ||
@BuildStep | ||
void registerProvidersFromAnnotations(CombinedIndexBuildItem indexBuildItem, |
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 am fairly certain that the generated class can be replaced by a synthetic bean which would make maintenance a lot easier
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'll see if I can do that
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 created a version with synthetic bean: #16815
It has its own drawbacks: more code, usage of Class.forName
and registering classes for reflection. I have a slight preference on this version but I don't mind if we merge the other.
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 prefer #16815, but it's up to you as this is your baby :)
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.
okay, let's go with this one then :)
If it's okay now, can you approve?
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.
As you wish :)
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 like the approach, I just added a couple minor and a more serious question about the implementation
ce75636
to
0557762
Compare
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.
Thanks a lot!
related to #16702
Before the change, providers registered with the
@RegisterProvider
annotation were registered in the generated stub, on the WebTarget. While this is enough for most non-MP-specific cases, it is not for microprofile ones, like ResponseExceptionMapper.This change introduces a new bean
AnnotationRegisteredProviders
that stores information about the provider classes coming from annotations. This bean is used when a rest client stub is built withRestClientBuilderImpl
.The info about the annotations is gathered at build-time. The bean has an abstract superclass to minimize the amount of generated bytecode.