@FunctionalInterface public interface DuplicateCommandHandlerResolver
MessageHandlerinstances and returns another one as the resolution.
|Modifier and Type||Method and Description|
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.
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
RuntimeException- when registration should fail
Copyright © 2010–2021. All rights reserved.