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

Support Publisher as a return type in RESTEasy Reactive as well #15532

Merged
merged 1 commit into from
Mar 8, 2021

Conversation

geoand
Copy link
Contributor

@geoand geoand commented Mar 8, 2021

Fixes: #15519

@geoand geoand requested a review from FroMage March 8, 2021 09:54
@quarkus-bot quarkus-bot bot added the area/rest label Mar 8, 2021
private void handleStreaming(ResteasyReactiveRequestContext requestContext, Multi<?> result, boolean json) {
result.subscribe().withSubscriber(new StreamingMultiSubscriber(requestContext, json));
private void handleStreaming(ResteasyReactiveRequestContext requestContext, Publisher<?> result, boolean json) {
result.subscribe(new StreamingMultiSubscriber(requestContext, json));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not very important, but in the case of Multi (and only in this case - which would duplicate the code), you can do:

result.subscribe().withSafeSubscriber(...)

In this case, Mutiny disables all the serialization / TCK checks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's nice!

We can use that actually by checking if result is Multi and doing this special handling in such a case.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird, I can't find withSafeSubscriber anywhere :)

@geoand geoand merged commit f9bd501 into quarkusio:master Mar 8, 2021
@quarkus-bot quarkus-bot bot added this to the 1.13 - master milestone Mar 8, 2021
@geoand geoand deleted the #15519 branch March 8, 2021 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Returning a Publisher<T> is not working when using resteasy reactive
2 participants