All Superinterfaces:
DescribableComponent
All Known Implementing Classes:
DefaultReactorQueryGateway

public interface ReactorQueryGateway extends DescribableComponent
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 Type
    Method
    Description
    default <R> reactor.core.publisher.Mono<R>
    query(Object query, Class<R> responseType)
    Sends the given query and returns a Mono with a single typed result.
    <R> reactor.core.publisher.Mono<R>
    query(Object query, Class<R> responseType, @Nullable ProcessingContext context)
    Sends the given query in the provided context (if available) and returns a Mono with a single typed result.
    default <R> reactor.core.publisher.Mono<List<R>>
    queryMany(Object query, Class<R> responseType)
    Sends the given query and returns a Mono with a list of typed results.
    <R> reactor.core.publisher.Mono<List<R>>
    queryMany(Object query, Class<R> responseType, @Nullable ProcessingContext context)
    Sends the given query in the provided context (if available) and returns a Mono with a list of typed results.
    default <R> reactor.core.publisher.Flux<R>
    streamingQuery(Object query, Class<R> responseType)
    Sends the given query as a streaming query, returning results as a Flux.
    <R> reactor.core.publisher.Flux<R>
    streamingQuery(Object query, Class<R> responseType, @Nullable ProcessingContext context)
    Sends the given query in the provided context (if available) as a streaming query, returning results as a Flux.
    default <R> reactor.core.publisher.Flux<R>
    subscriptionQuery(Object query, Class<R> responseType)
    Sends the given query as a subscription query, combining the initial result and subsequent updates as a Flux.
    <R> reactor.core.publisher.Flux<R>
    subscriptionQuery(Object query, Class<R> responseType, @Nullable ProcessingContext context)
    Sends the given query in the provided context (if available) as a subscription query, combining the initial result and subsequent updates as a Flux.

    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 given query in the provided context (if available) and returns a Mono with a single typed result.
      Type Parameters:
      R - the response type
      Parameters:
      query - the query payload to send
      responseType - the expected response type
      context - the processing context, if any, to dispatch the given query in
      Returns:
      a Mono completing with the query result
    • query

      default <R> reactor.core.publisher.Mono<R> query(Object query, Class<R> responseType)
      Sends the given query and returns a Mono with a single typed result.
      Type Parameters:
      R - the response type
      Parameters:
      query - the query payload to send
      responseType - the expected response type
      Returns:
      a Mono completing 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 given query in the provided context (if available) and returns a Mono with a list of typed results.
      Type Parameters:
      R - the element type
      Parameters:
      query - the query payload to send
      responseType - the expected element type
      context - the processing context, if any, to dispatch the given query in
      Returns:
      a Mono completing with a list of query results
    • queryMany

      default <R> reactor.core.publisher.Mono<List<R>> queryMany(Object query, Class<R> responseType)
      Sends the given query and returns a Mono with a list of typed results.
      Type Parameters:
      R - the element type
      Parameters:
      query - the query payload to send
      responseType - the expected element type
      Returns:
      a Mono completing 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 given query in the provided context (if available) as a streaming query, returning results as a Flux.
      Type Parameters:
      R - the element type
      Parameters:
      query - the query payload to send
      responseType - the expected element type
      context - the processing context, if any, to dispatch the given query in
      Returns:
      a Flux streaming query results
    • streamingQuery

      default <R> reactor.core.publisher.Flux<R> streamingQuery(Object query, Class<R> responseType)
      Sends the given query as a streaming query, returning results as a Flux.
      Type Parameters:
      R - the element type
      Parameters:
      query - the query payload to send
      responseType - the expected element type
      Returns:
      a Flux streaming query results
      See Also:
    • subscriptionQuery

      <R> reactor.core.publisher.Flux<R> subscriptionQuery(Object query, Class<R> responseType, @Nullable ProcessingContext context)
      Sends the given query in the provided context (if available) as a subscription query, combining the initial result and subsequent updates as a Flux.
      Type Parameters:
      R - the response type
      Parameters:
      query - the query payload to send
      responseType - the response type for both initial result and updates
      context - the processing context, if any, to dispatch the given query in
      Returns:
      a Flux streaming the initial result followed by updates
    • subscriptionQuery

      default <R> reactor.core.publisher.Flux<R> subscriptionQuery(Object query, Class<R> responseType)
      Sends the given query as a subscription query, combining the initial result and subsequent updates as a Flux.
      Type Parameters:
      R - the response type
      Parameters:
      query - the query payload to send
      responseType - the response type for both initial result and updates
      Returns:
      a Flux streaming the initial result followed by updates
      See Also: