Interface QueryInvocationErrorHandler

All Known Implementing Classes:
LoggingQueryInvocationErrorHandler

public interface QueryInvocationErrorHandler
Interface describing a mechanism for the QueryMessage components to report errors.

Note that this handler is not used for point-to-point queries. In that case, exceptions are reported directly to the invoker. Query Bus implementation may choose to implement point-to-point queries as scatter-gather, and only reporting the first answer returned. In that case, this handler is invoked, and any propagated exceptions may or may not be reported to the sender of the query.

Since:
3.1
Author:
Allard Buijze, Marc Gathier
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    onError(Throwable error, QueryMessage<?,?> queryMessage, MessageHandler messageHandler)
    Invoked when an error occurred while invoking a message handler in a scatter-gather query.
  • Method Details

    • onError

      void onError(@Nonnull Throwable error, @Nonnull QueryMessage<?,?> queryMessage, @Nonnull MessageHandler messageHandler)
      Invoked when an error occurred while invoking a message handler in a scatter-gather query. Implementations may throw an exception to propagate the error to the caller. In that case, the QueryBus implementation will receive the exception, and may choose to propagate the error to the sender of the query.

      Note that this handler is not used for point-to-point queries. In that case, exceptions are reported directly to the invoker. Query Bus implementation may choose to implement point-to-point queries as scatter-gather, and only reporting the first answer returned. In that case, this method is invoked, and any propagated exceptions may or may not be reported to the sender of the query.

      Parameters:
      error - The error that occurred
      queryMessage - The message causing the exception in the handler
      messageHandler - The handler that reported the exception