quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.82k stars 2.69k forks source link

@Blocking not work with import quarkus-smallrye-openapi #34798

Open francesco-be-solution opened 1 year ago

francesco-be-solution commented 1 year ago

Describe the bug

In the Service Grpc (Iam Grpc) the annotation at @Blocking dont 'work with a dependecy quarkus-smallrye-openapi . If i comment this dependecy and i test my service grpc , blocking run correctly . I usage this dependecy because have a client redis blocking . Could you please help me on this Attach my project . ms-be.zip

Expected behavior

We expect that using the openApi library does not give problems with the use of the annotation @Blocking .

Actual behavior

Invoking the GRPC server (impl the MutinyService) with the Open API library, annotation @Blocking dont't block the thread and generate this error on invoke the client redis :

The current thread cannot be blocked: vert.x-eventloop-thread-1

How to Reproduce?

1) After create a endpoint rest , import libraries in pom (ms-be.zip) 2) Create a simple proto.file 3)Implement the interface grpc for MutinyApi 4) Call endpoint and set a key with value on redis.

note: if use impl googleApi grpc quarkus don't generate exception . Otherwise if use mutiny api generate exception : The current thread cannot be blocked: vert.x-eventloop-thread-1 ms-be.zip

Thank you very much for your attention and your work :)

Output of uname -a or ver

No response

Output of java -version

17

GraalVM version (if different from Java)

none

Quarkus version or git rev

2.13.3.Final ### Build tool (ie. output of `mvnw --version` or `gradlew --version`) 3.10.1 ### Additional information _No response_
quarkus-bot[bot] commented 1 year ago

/cc @EricWittmann (openapi), @Ladicek (smallrye), @MikeEdgar (openapi), @jmartisk (smallrye), @phillip-kruger (openapi,smallrye), @radcortez (smallrye)

phillip-kruger commented 1 year ago

@cescoffier ^^^

@francesco-be-solution is there a reason you use Uni and @Blocking ? You can get blocking by removing the Uni and return the POJO

francesco-be-solution commented 1 year ago

Mutiny is the api I use for the GRPC service. I expose a grpc service and use that classes stub which generate the Mutiny API. The return type is UNI and my redis client is non responsive . I need to use annotation blocking which fires until I import the open api library