public class LoggingDuplicateCommandHandlerResolver extends Object implements DuplicateCommandHandlerResolver
|Modifier and Type||Method and Description|
Returns an instance that logs duplicate registrations.
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 LoggingDuplicateCommandHandlerResolver 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–2020. All rights reserved.