-
Notifications
You must be signed in to change notification settings - Fork 784
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Flux<...> as QueryHandler return type #1002
Comments
Thanks for your feature request @raphael-jungers. |
I finally managed to use spring-data-cassandra-reactive with cassandra as the query database without any change to the framework. Here's a code example for those interested : The Controller :
The QueryHandler :
The EventHandler (emitting updates)
|
Great you got that working! :) |
+1, and maybe kotlin coroutine should also be supported |
@UkonnRa please maintain Kotlin specific requests to the Kotlin Extension Repository. We know you've dropped an issue request there, but simply reiterating the fact here does not increase prioritization on the matter. We first need to figure out an implementation tactic for the matter (hence the "Under Discussion" tag) prior to initiation work on it. Of course, implementation suggestion or a pull request are very much valued from any users of Axon. Thus if you are up for the task, I'd be looking forward to reviewing your PR! |
Just stumbled upon this use case and ended up doing what looks like a dirty workaround: Flux<Foo> orderedProducts = Mono.fromFuture(queryGateway.query(new FindFoos(), ResponseTypes.multipleInstancesOf(Foo.class)))
.flatMapMany(Flux::fromIterable); |
I think we've missed adding this issue to milestone 4.6.0, when we started our efforts on the Streaming Query support we introduced in #2001. With that in place you can use @QueryHandler
public Flux<Order> handle(FindAllOrdersQuery query) {
return Flux.of(...
} Given the nature of this issue, we feel the aforementioned support is thus present as of 4.6.0 of Axon Framework. |
Please also note that using the reactor extension, we do offer a subscription query with a flux return type. |
When using Spring Data with reactive repositories, the methods return types are Mono<...> or Flux<...>. The QueryGateway doesn't seem to support these types as QueryHandlers return types.
I'm mostly interested in using the subscriptionQuery method with a Flux as the initial response type.
The text was updated successfully, but these errors were encountered: