Hi guys, I'm using spring boot webflux with kotlin...
# coroutines
g
Hi guys, I'm using spring boot webflux with kotlin and I was wondering if anyone knows the pros and cons of cast everything with asflow() since spring returns mono or flux. Implementations of mono and flux are based on coroutines since I use the coroutines reactive package .
r
We're using Webflux with coroutines and it's... not good, lol. It works, usually, but there are lots of pain points. The
.asFlow()
extension method specifically are meant to be used. I think it's provided by the actual Kotlin team.
g
Yes it is provided by the kotlin team , but also the mono and the flux impls which are based on coroutines are also provided by the kotlin team . Long story short my team mixes mono, flux and flow. I'm trying to dig deeper if this is ok or we are doing something wrong. My hunch tells me to cast everything as flow.
t
hey Richard, what are your pain points with couroutines? I'm using it and quite please. So just curious about the problems you have.
r
@thanh To clarify, my pain points are related to Spring Webflux and project Reactor, including interacting with it from coroutines. I enjoy coroutines — it's just that Webflux has a lot of issues. One of the biggest pains is that even with coroutines error stack traces are massive due to the underlying FLux/Mono usage in Spring.
t
ah, got it. I meant that I also use coroutines with Web flux, Spring, and it works well together.