-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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 Kotlin suspend functions when using @ConsumeEvent #26728
Comments
/cc @evanchooly |
Indeed |
Are there any plans to support this? |
It's pretty low on the list of priorities |
I have an experimental branch where I rewrote various things in Quarkus that generate their own invoker classes to use CDI 4.1 method invokers. With them, supporting Kotlin suspend functions is straightforward, just a matter of configuring an invoker wrapper, which is one simple Kotlin class. One of the things I rewrote is also |
You can use this setup:
You would want to execute the coroutines on the Vertx dispatcher.
You'll need these 2:
|
Thanks you @Ladicek |
Describe the bug
I added a method that should consume an event published by the vertx event bus:
When I build the application, the build fails with the following exception:
Looks like, suspend functions with this annotation do not work properly. If I remove the suspend keyword everything works as expected.
Expected behavior
It should be possible to receive events using kotlin suspend functions.
Actual behavior
Using suspend functions with the ConsumeEvent annotation results in a failing build
How to Reproduce?
No response
Output of
uname -a
orver
Darwin MB-07-P15.fritz.box 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64
Output of
java -version
openjdk version "17.0.3" 2022-04-19 OpenJDK Runtime Environment Homebrew (build 17.0.3+0) OpenJDK 64-Bit Server VM Homebrew (build 17.0.3+0, mixed mode, sharing)
GraalVM version (if different from Java)
No response
Quarkus version or git rev
2.10.2.Final
Build tool (ie. output of
mvnw --version
orgradlew --version
)------------------------------------------------------------ Gradle 7.4.2 ------------------------------------------------------------ Build time: 2022-03-31 15:25:29 UTC Revision: 540473b8118064efcc264694cbcaa4b677f61041 Kotlin: 1.5.31 Groovy: 3.0.9 Ant: Apache Ant(TM) version 1.10.11 compiled on July 10 2021 JVM: 17.0.3 (Homebrew 17.0.3+0) OS: Mac OS X 10.15.7 x86_64
Additional information
No response
The text was updated successfully, but these errors were encountered: