Quarkus Kafka Kotlin Coroutines does not work
See original GitHub issueDescribe the bug
Hello to all. When trying to use Kotlin suspending functions together with Quarkus Kafka I am getting the following exception:
SRMSG00201: Error caught while processing a message: java.lang.IllegalStateException: No Vertx context found
I have simply defined the following code:
@Incoming("order-in")
suspend fun consumeOrderEvents(orderRecord: Record<String, Order>) {
After analysing the issue I found that the code is not being called on a Vertx Thread as the exception is thrown from the following snippet:
val dispatcher: CoroutineDispatcher = Vertx.currentContext()?.let(::VertxDispatcher)
?: throw IllegalStateException("No Vertx context found")
in the AbstractSubscribingCoroutineInvoker
class .
Is there anything I have to watch out for when configuring Quarkus Kafka and Kotlin ?
Issue Analytics
- State:
- Created 2 years ago
- Reactions:2
- Comments:20 (9 by maintainers)
Top Results From Across the Web
Using Kotlin - Quarkus
Kotlin is a very popular programming language that targets the JVM (amongst ... Having final classes however does not work well with various...
Read more >Quarkus CDI context with Kotlin coroutines - Stack Overflow
I'm trying to offload some Hibernate / Hibernate Search calls to a different thread, but I'm getting errors suggesting CDI is not set...
Read more >Kotlin Coroutines in Quarkus Ecosystem | by Praveen Ray
On the other hand, Kotlin's preferred way is to use Co-Routines. This causes friction at times and sometimes it's not obvious how to...
Read more >Why I stopped using Coroutines in Kotlin - DEV Community
However, when Coroutines enter the mix, one thread no longer does one thing. Look closely: remoteCall(request) calls a suspend ing function - we ......
Read more >Hello folks wave Is someone using Quarkus with kotlin for a
Hello folks wave Is someone using Quarkus with kotlin for a while I d like to know about ... coroutines into Uni/Multi and...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As far as I’m aware, this appears to be fixed and the issue can be closed. I didn’t open this issue, though.
Looks good now with
2.8.0.CR1
. Thank you and looking forward to the final release!