Class LoggingDuplicateQueryHandlerResolver

java.lang.Object
org.axonframework.queryhandling.registration.LoggingDuplicateQueryHandlerResolver
All Implemented Interfaces:
DuplicateQueryHandlerResolver

public class LoggingDuplicateQueryHandlerResolver extends Object implements DuplicateQueryHandlerResolver
Implementation of the DuplicateQueryHandlerResolver that allows registrations to be overridden by new handlers, but logs this (on WARN level) to a given logger.
Since:
4.6.0
Author:
Mitchell Herrijgers
  • Method Details

    • instance

      public static LoggingDuplicateQueryHandlerResolver instance()
      Returns an instance that logs duplicate registrations.
      Returns:
      an instance that logs duplicate registrations
    • resolve

      public List<QuerySubscription<?>> resolve(String queryName, Type responseType, List<QuerySubscription<?>> registeredHandlers, QuerySubscription<?> candidateHandler)
      Description copied from interface: DuplicateQueryHandlerResolver
      Chooses what to do when a duplicate handler is registered, returning the handlers that should be selected for query handling, or otherwise throwing an exception to reject registration altogether.
      Specified by:
      resolve in interface DuplicateQueryHandlerResolver
      Parameters:
      queryName - The name of the query for which the duplicate was detected
      registeredHandlers - the MessageHandler instances already registered with the Query Bus
      candidateHandler - the MessageHandler that is newly registered and conflicts with the existing registrations
      Returns:
      the resolved MessageHandler instances. It is up to the implementation to discard implementations already in the list