quarkus: quarkus-resteasy-reactive slower than quarkus-resteasy when returning Multi
Describe the bug
When a JAX-RS endpoint returns Multi with the quarkus-resteasy-reactive extension, the response time is unstable and sometimes much higher than with quarkus-resteasy.
Expected behavior
Stable and reasonable response time with quarkus-resteasy-reactive.
To Reproduce
https://github.com/gwenneg/quarkus-resteasy-reactive-response-time
This repo contains two subfolders which contain the exact same code. The only different file is pom.xml:
- the
resteasysubfolder depends onquarkus-resteasyandquarkus-resteasy-mutiny - the
resteasy-reactivesubfolder depends onquarkus-resteasy-reactive
Steps to reproduce the behavior:
cd resteasy-reactive./mvnw clean quarkus:dev- Go to http://localhost:8080/test/uni and look at the response time, it should be good
- Repeat a few times, the response time should be stable
- Go to http://localhost:8080/test/multi and look at the response time, it may or may not be good
- Repeat a few times, the response time should be unstable and sometimes really bad
If you follow the same steps with the resteasy subfolder, the response time should always be good and stable with both Uni and Multi.
Environment (please complete the following information):
Output of java -version
$ java -version
openjdk version "11.0.9.1" 2020-11-04
Quarkus version or git rev
1.13.3.Final
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15 (14 by maintainers)
Ok, I was missing
-T application/json. I updated the uni results above.Multi:
reactive:
non-reactive:
YMMV!
I’m going to close this as it does not seem to be an issue. If it is an issue, please reopen and/or comment with updated information
OK great, thanks 😃
That’s exactly my point.
That unless you are really streaming data back to the client,
Uni<List>is likely what you want to return