question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Quarkus Kafka Kotlin Coroutines does not work

See original GitHub issue

Describe 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:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:20 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
lspahijacommented, Mar 25, 2022

As far as I’m aware, this appears to be fixed and the issue can be closed. I didn’t open this issue, though.

1reaction
lspahijacommented, Mar 25, 2022

Looks good now with 2.8.0.CR1. Thank you and looking forward to the final release!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found