snowdrop-zen / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
1 stars 0 forks source link

`@Blocking` on resource is ignored if implementing an OpenAPI-generated interface #301

Closed aureamunoz closed 3 years ago

aureamunoz commented 3 years ago

Describe the bug

When generating interfaces from a OpenAPI defintion file via https://github.com/OpenAPITools/openapi-generator, all Jax-RS annotations are added to the interface so you don't have to repeat them in your actual resource that implements the interface. If you decide that you need @Blocking, you have to put it in the interface to have it recognized.

Expected behavior

Since blocking or not is an implementation detail, I should not be forced to put this in the (generated) resource interface.

Actual behavior

As soon as a resource implements an interface that contains alls the Jax-RS annotations, @Blocking on the actually implemented methods (or the resource class) is ignored.

To Reproduce

https://github.com/quarkusio/quarkus-quickstarts/compare/main...famod:issue-15940

Steps to reproduce the behavior:

  1. git clone https://github.com/famod/quarkus-quickstarts.git
  2. git switch issue-15940
  3. cd getting-started-reactive
  4. mvn verify (no error)
  5. remove @Blocking from ReactiveGreeting.greeting()
  6. mvn verify (error regarding IO thread)

Configuration

quarkus.datasource.db-kind=h2
quarkus.datasource.username=sa
quarkus.datasource.password=sa
quarkus.datasource.jdbc.url=jdbc:h2:mem:test_quarkus;DB_CLOSE_DELAY=-1

Environment (please complete the following information):

Output of uname -a or ver

Linux XXX 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux

Output of java -version

openjdk version "11.0.10" 2021-01-19
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9)
Eclipse OpenJ9 VM AdoptOpenJDK (build openj9-0.24.0, JRE 11 Linux amd64-64-Bit Compressed References 20210120_910 (JIT enabled, AOT enabled)
OpenJ9   - 345e1b09e
OMR      - 741e94ea8
JCL      - 0a86953833 based on jdk-11.0.10+9)

(also happens with HotSpot)

GraalVM version (if different from Java)

-

Quarkus version or git rev

1.12.2

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

Apache Maven 3.6.3

Additional context


https://github.com/quarkusio/quarkus/issues/15940


$upstream:15940$