Closed gsmet closed 8 months ago
Reactor is stuck on Java 6 era Reactive Streams APIs while we're on JDK Flow
APIs, hence the cast fails.
There are 2 options:
Publisher
to a Flow.Publisher
@jponge what I don't know is how I can figure out where to fix that given the stack is not helping. I was wondering if you would have some advice? Also maybe we should translate the reactor things directly to Mutiny in the project itself.
Note that it's not my project, I was just trying to help moving it to Quarkus 3.7 and trying to release a first version as people were asking for it.
I feel the pain on these kind of stack traces.
If you are in the know-how of reactive streams and the 2 APIs in the wild then the class cast issue makes sense, but if not, it doesn't make sense.
I'll have a look at Discord4J to see if it'd be a good candidate for Mutiny/Mutiny Zero, or if it's yet another library that uses Reactor to be "reactive" while it just puts streams from non-backpressured in-memory data chunks.
@jponge yeah, I'm not sure we'll be able to make a push in the upstream library but if we could at least be clean on the Quarkus extension side and make sure we don't do anything wrong, that would be awesome. I don't think there is a lot of code to check, it looks like a relatively small project on the Quarkus side.
Thanks!
I'm looking at the code.
The stacktrace is because there's a flatMap
in Reactor Flux
where a Multi
gets returned from the flatMap
function (e.g., flux.flatMap(n -> functionThatReturnsMulti(n)
). This used to work when Mutiny was based on legacy / Java 6 Reactive Streams APIs, but not since we moved to JDK Flow
APIs.
I'm still unsure if it's just the test case that needs a fix, or if there's something more fundamental to fix, especially as there's lots of code generation (and I'm not sure why this is all needed when we have a client library, but...). Also note that this client uses reactor-netty
, hence more events loops in Quarkus applications that will use it.
Hey @jponge ,
Discord4j is using Mono and when executing the tests, I get this error:
There's probably something wrong somewhere and your insights would be welcome!