Interface ReactorQueryGateway
- All Superinterfaces:
DescribableComponent
- All Known Implementing Classes:
DefaultReactorQueryGateway
Reactor query gateway that runs dispatch interceptors inside the Reactor subscription.
Use this instead of QueryGateway when interceptors need
access to Reactor context (e.g., ReactiveSecurityContextHolder).
The interceptor chain is built and executed within the Reactor subscription, ensuring that the Reactor
Context is available throughout the entire dispatch pipeline.
- Since:
- 4.4.2
- Author:
- Milan Savic, Theo Emanuelsson
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault <R> reactor.core.publisher.Mono<R> Sends the givenqueryand returns aMonowith a single typed result.<R> reactor.core.publisher.Mono<R> query(Object query, Class<R> responseType, @Nullable ProcessingContext context) Sends the givenqueryin the providedcontext(if available) and returns aMonowith a single typed result.default <R> reactor.core.publisher.Mono<List<R>> Sends the givenqueryand returns aMonowith a list of typed results.<R> reactor.core.publisher.Mono<List<R>> queryMany(Object query, Class<R> responseType, @Nullable ProcessingContext context) Sends the givenqueryin the providedcontext(if available) and returns aMonowith a list of typed results.default <R> reactor.core.publisher.Flux<R> streamingQuery(Object query, Class<R> responseType) Sends the givenqueryas a streaming query, returning results as aFlux.<R> reactor.core.publisher.Flux<R> streamingQuery(Object query, Class<R> responseType, @Nullable ProcessingContext context) Sends the givenqueryin the providedcontext(if available) as a streaming query, returning results as aFlux.default <R> reactor.core.publisher.Flux<R> subscriptionQuery(Object query, Class<R> responseType) Sends the givenqueryas a subscription query, combining the initial result and subsequent updates as aFlux.<R> reactor.core.publisher.Flux<R> subscriptionQuery(Object query, Class<R> responseType, @Nullable ProcessingContext context) Sends the givenqueryin the providedcontext(if available) as a subscription query, combining the initial result and subsequent updates as aFlux.Methods inherited from interface org.axonframework.common.infra.DescribableComponent
describeTo
-
Method Details
-
query
<R> reactor.core.publisher.Mono<R> query(Object query, Class<R> responseType, @Nullable ProcessingContext context) Sends the givenqueryin the providedcontext(if available) and returns aMonowith a single typed result.- Type Parameters:
R- the response type- Parameters:
query- the query payload to sendresponseType- the expected response typecontext- the processing context, if any, to dispatch the givenqueryin- Returns:
- a
Monocompleting with the query result
-
query
Sends the givenqueryand returns aMonowith a single typed result.- Type Parameters:
R- the response type- Parameters:
query- the query payload to sendresponseType- the expected response type- Returns:
- a
Monocompleting with the query result - See Also:
-
queryMany
<R> reactor.core.publisher.Mono<List<R>> queryMany(Object query, Class<R> responseType, @Nullable ProcessingContext context) Sends the givenqueryin the providedcontext(if available) and returns aMonowith a list of typed results.- Type Parameters:
R- the element type- Parameters:
query- the query payload to sendresponseType- the expected element typecontext- the processing context, if any, to dispatch the givenqueryin- Returns:
- a
Monocompleting with a list of query results
-
queryMany
Sends the givenqueryand returns aMonowith a list of typed results.- Type Parameters:
R- the element type- Parameters:
query- the query payload to sendresponseType- the expected element type- Returns:
- a
Monocompleting with a list of query results - See Also:
-
streamingQuery
<R> reactor.core.publisher.Flux<R> streamingQuery(Object query, Class<R> responseType, @Nullable ProcessingContext context) Sends the givenqueryin the providedcontext(if available) as a streaming query, returning results as aFlux.- Type Parameters:
R- the element type- Parameters:
query- the query payload to sendresponseType- the expected element typecontext- the processing context, if any, to dispatch the givenqueryin- Returns:
- a
Fluxstreaming query results
-
streamingQuery
Sends the givenqueryas a streaming query, returning results as aFlux.- Type Parameters:
R- the element type- Parameters:
query- the query payload to sendresponseType- the expected element type- Returns:
- a
Fluxstreaming query results - See Also:
-
subscriptionQuery
<R> reactor.core.publisher.Flux<R> subscriptionQuery(Object query, Class<R> responseType, @Nullable ProcessingContext context) Sends the givenqueryin the providedcontext(if available) as a subscription query, combining the initial result and subsequent updates as aFlux.- Type Parameters:
R- the response type- Parameters:
query- the query payload to sendresponseType- the response type for both initial result and updatescontext- the processing context, if any, to dispatch the givenqueryin- Returns:
- a
Fluxstreaming the initial result followed by updates
-
subscriptionQuery
Sends the givenqueryas a subscription query, combining the initial result and subsequent updates as aFlux.- Type Parameters:
R- the response type- Parameters:
query- the query payload to sendresponseType- the response type for both initial result and updates- Returns:
- a
Fluxstreaming the initial result followed by updates - See Also:
-