-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Register any additional necessary providers for server sent event @Produce(s) #4167
Conversation
@gsmet, I understand what you mean.
Okay, so instead of expecting users to use an
I have looked at the code that you pointed to (the 3 places) and do understand what you mean. However, those 3 places won't be the right place to do this logic, since those 3 places are processing the providers that have been found in the classpath, rather than the user's application resources which use those providers. That latter part happens later and I have updated this PR to use this common logic in that central place where it happens for The commit in this PR now adds the Furthermore, I have included a test case to test the server sent events. Do note that this test case is ineffective in reproducing the original reported issue because of the way we run our integration tests, where multiple other JaxRS endpoints are scanned and because of their usage of |
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 think this proposal from Jaikiran is fine; see section 5 at https://docs.jboss.org/resteasy/docs/4.3.0.Final/userguide/html/Reactive.html#d4e2322
Please wait. AFAICS there is also I think I would add What I'm unclear about is the precedence between the @asoldano could you shed some light on this? |
@gsmet up to you :) |
@gsmet uh, thanks, I would need to run some tests, but you might have made me notice a "bug". So |
Thank you @asoldano for all these details and the review and thank you @gsmet for the patience with this review. I have now pushed a change to this PR which takes into account what we have discussed here. The comments in the code should summarize how we deal with it now (essentially the same as what we decided here). Additionally, my manual testing of that Kafka guide, without that workaround, for various permutations/combinations of the |
There are some formatting issues. You can do |
Interesting - I was under the impression, |
Clean install should do the trick. It has so often however that we commit before doing 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.
@jaikiran I added a very minor comment but the main thing is that it needs a rebase (I would have merged as is if not).
Could you take care of the rebase and fix my minor remark along the way?
Other than that, it's perfect, thanks a lot for this.
Thanks!
.../deployment/src/main/java/io/quarkus/resteasy/common/deployment/ResteasyCommonProcessor.java
Outdated
Show resolved
Hide resolved
Hi @gsmet, I've updated this PR after rebasing with latest and also incorporated the (valid) change that you mentioned in the latest comment. |
Merged, very nice improvement, thanks! |
The commit here introduces a way where any additional necessary
providers
are registered for any resource that@Produces
MediaType.SERVER_SENT_EVENTS
. This should allow for fixing the issue reported in #2176 such that thePriceResouce
in that example can now use:and will no longer require a (dummy) resource endpoint to register the basic
text/plain
type providers.Fixes #2176