I’m using Axon 4.5.9 in Kotlin Spring Boot web application. This application has a web layer which is accessible via GraphQL API (graphql-kotlin-spring-server 5.2.0) and inside code of Web endpoints call Axon with sendAndWait method.
As GraphQL API uses internally reactive non-blocking approach and sendAndWait is a synchonius one. Take a note that web service is implemented on Kotlin, who provides functionality of corutines.
So I’m woundering how to cook web endpoint correctly Kotlin(corutines) + GraphQL(reactive) + Axon(synchronous sendAndWait)?
Hi, having used (and contributed a bit) graphql-kotlin before without Axon, and having using Netflix dgs with Axon, I find this an interesting question.
In my experience, it’s better not to mix coroutines to muchwith code that’s not async in nature, as it can cause weird bugs if you aren’t careful. With that in mind I think it would be easiest to either use the Kotlin and/or reactive extension.
I don’t have an example or experience using coroutines with Axon.