quarkus: RESTEasy Reactive: Reactive filter hangs the request when reading the body

Describe the bug

When using RESTEasy Reactive with a Reactive filter, if we try to read the request body inside the filter, the filter is not terminating at all, so the request never returns a response.

Note that this happens even when paying attention to making the stream read in the Quarkus worker thread, and then returning back to the vert.x thread, so it should not have problems there.

Expected behavior

When using a request filter and reading the body inside the filter, the filter should complete properly and the HTTP request should proceed and be successful.

Actual behavior

The http request never returns a response when the filter is used.

How to Reproduce?

  1. Download the example Project
  2. Run the project using mvn compile quarkus:dev
  3. Make a request using the following curl:
curl --request POST \
--url http://localhost:8080/getDummyId \
--header 'Accept: application/json' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data id=1

You will notice that the request never completes.

Output of uname -a or ver

Darwin 20.6.0 Darwin Kernel Version 20.6.0: Mon Aug 30 06:12:21 PDT 2021; root:xnu-7195.141.6~3/RELEASE_X86_64 x86_64

Output of java -version

OpenJDK 64-Bit Server VM Temurin-11.0.13+8 (build 11.0.13+8, mixed mode)

GraalVM version (if different from Java)

No response

Quarkus version or git rev

2.6.3.Final

Build tool (ie. output of mvnw --version or gradlew --version)

maven

Additional information

Note that after reading the HTTP Request body, we pay attention to setting a new InputStream to the http request using setEntityStream. This is a methodology that has worked nicely in the non-reactive version of RESTEasy. So one would expect that the filter would not have a problem doing the same thing using the same APIs in RESTEasy Reactive.

About this issue

  • Original URL
  • State: open
  • Created 2 years ago
  • Comments: 20 (9 by maintainers)

Most upvoted comments

@csotiriou I think what you’ve done should work