Class FailingDuplicateQueryHandlerResolver
java.lang.Object
org.axonframework.queryhandling.registration.FailingDuplicateQueryHandlerResolver
- All Implemented Interfaces:
DuplicateQueryHandlerResolver
public class FailingDuplicateQueryHandlerResolver
extends Object
implements DuplicateQueryHandlerResolver
Implementation of
DuplicateQueryHandlerResolver that throws a DuplicateQueryHandlerSubscriptionException
when a duplicate registration is detected.- Since:
- 4.6.0
- Author:
- Mitchell Herrijgers
-
Method Summary
Modifier and TypeMethodDescriptioninstance()Returns aDuplicateQueryHandlerResolverthat throws an exception when a duplicate registration is detectedresolve(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 aDuplicateQueryHandlerResolverthat throws an exception when a duplicate registration is detected- Returns:
- a
DuplicateQueryHandlerResolverthat throws an exception when a duplicate registration is detected
-
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
-