public class FailingDuplicateCommandHandlerResolver extends Object implements DuplicateCommandHandlerResolver
DuplicateCommandHandlerResolverthat throws a
DuplicateCommandHandlerSubscriptionExceptionwhen a duplicate registration is detected.
|Modifier and Type||Method and Description|
Returns a DuplicateCommandHandlerResolver that throws an exception when a duplicate registration is detected
Chooses what to do when a duplicate handler is registered, returning the handler that should be selected for command handling, or otherwise throwing an exception to reject registration altogether.
public static FailingDuplicateCommandHandlerResolver instance()
public MessageHandler<? super CommandMessage<?>> resolve(String commandName, MessageHandler<? super CommandMessage<?>> registeredHandler, MessageHandler<? super CommandMessage<?>> candidateHandler)
commandName- The name of the Command for which the duplicate was detected
MessageHandlerpreviously registered with the Command Bus
MessageHandlerthat is newly registered and conflicts with the existing registration
MessageHandler. Could be the
candidateHandleror another handler entirely
Copyright © 2010–2021. All rights reserved.