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 Summary
Modifier and TypeMethodDescriptioninstance()Returns an instance that logs duplicate registrations.resolve(String queryName, Type responseType, List<QuerySubscription<?>> registeredHandlers, QuerySubscription<?> candidateHandler) 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.
-
Method Details
-
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:DuplicateQueryHandlerResolverChooses 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:
resolvein interfaceDuplicateQueryHandlerResolver- Parameters:
queryName- The name of the query for which the duplicate was detectedregisteredHandlers- theMessageHandlerinstances already registered with the Query BuscandidateHandler- theMessageHandlerthat is newly registered and conflicts with the existing registrations- Returns:
- the resolved
MessageHandlerinstances. It is up to the implementation to discard implementations already in the list
-