Interface SubscriptionQueryResult<I,U>

All Superinterfaces:
AutoCloseable, Registration
All Known Implementing Classes:
AxonServerSubscriptionQueryResult, DefaultSubscriptionQueryResult, DeserializedResult, DisposableResult

public interface SubscriptionQueryResult<I,U> extends Registration
Result of the subscription query. It contains publishers for initial result and incremental updates. Until there is a subscription to the publisher, nothing happens.
Since:
3.3
Author:
Milan Savic
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final org.slf4j.Logger
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    handle(Consumer<? super I> initialResultConsumer, Consumer<? super U> updateConsumer)
    Deprecated.
    Please use handle(Consumer, Consumer, Consumer) instead, to consciously deal with any exceptions with the errorConsumer.
    default void
    handle(Consumer<? super I> initialResultConsumer, Consumer<? super U> updateConsumer, Consumer<Throwable> errorConsumer)
    Delegates handling of initial result and incremental updates to the provided consumers.
    reactor.core.publisher.Mono<I>
    Subscribing to this mono will trigger invocation of query handler.
    reactor.core.publisher.Flux<U>
    When there is an update to the subscription query, it will be emitted to this flux.

    Methods inherited from interface org.axonframework.common.Registration

    cancel, close
  • Field Details

    • logger

      static final org.slf4j.Logger logger
  • Method Details

    • initialResult

      reactor.core.publisher.Mono<I> initialResult()
      Subscribing to this mono will trigger invocation of query handler. The return value of that query handler will be passed to the mono, once it's ready.
      Returns:
      the mono representing the initial result
    • updates

      reactor.core.publisher.Flux<U> updates()
      When there is an update to the subscription query, it will be emitted to this flux.
      Returns:
      the flux representing the incremental updates
    • handle

      @Deprecated default void handle(Consumer<? super I> initialResultConsumer, Consumer<? super U> updateConsumer)
      Deprecated.
      Please use handle(Consumer, Consumer, Consumer) instead, to consciously deal with any exceptions with the errorConsumer.
      Delegates handling of initial result and incremental updates to the provided consumers.

      Subscription to the incremental updates is done after the initial result is retrieved and its consumer is invoked. If anything goes wrong during invoking or consuming initial result or incremental updates, subscription is cancelled.

      Parameters:
      initialResultConsumer - The Consumer to be invoked when the initial result is retrieved.
      updateConsumer - The Consumer to be invoked when incremental updates are emitted.
    • handle

      default void handle(Consumer<? super I> initialResultConsumer, Consumer<? super U> updateConsumer, Consumer<Throwable> errorConsumer)
      Delegates handling of initial result and incremental updates to the provided consumers.

      Subscription to the incremental updates is done after the initial result is retrieved and its consumer is invoked. If anything goes wrong during invoking or consuming initial result or incremental updates, subscription is cancelled after invoking the given errorConsumer.

      Parameters:
      initialResultConsumer - The Consumer to be invoked when the initial result is retrieved.
      updateConsumer - The Consumer to be invoked when incremental updates are emitted.
      errorConsumer - A Consumer of Exception used to react to an exception resulting from the initialResult() or updates().