public abstract class AbstractRoutingStrategy extends Object implements RoutingStrategy
RoutingStrategy
interface that includes a fallback RoutingStrategy
which prescribes what happens when routing cannot be resolved by this implementation.Modifier | Constructor and Description |
---|---|
protected |
AbstractRoutingStrategy(RoutingStrategy fallbackRoutingStrategy)
Initializes the strategy using given
RoutingStrategy prescribing the fallback approach when this
implementation cannot resolve a routing key. |
|
AbstractRoutingStrategy(UnresolvedRoutingKeyPolicy fallbackRoutingStrategy)
Deprecated.
in favor of
AbstractRoutingStrategy(RoutingStrategy) |
Modifier and Type | Method and Description |
---|---|
protected abstract String |
doResolveRoutingKey(CommandMessage<?> command)
Resolve the Routing Key for the given
command . |
String |
getRoutingKey(CommandMessage<?> command)
Generates a routing key for the given
command . |
@Deprecated public AbstractRoutingStrategy(UnresolvedRoutingKeyPolicy fallbackRoutingStrategy)
AbstractRoutingStrategy(RoutingStrategy)
UnresolvedRoutingKeyPolicy
prescribing the fallback approach when
this implementation cannot resolve a routing key.fallbackRoutingStrategy
- the fallback routing to use whenever this RoutingStrategy
doesn't succeedprotected AbstractRoutingStrategy(RoutingStrategy fallbackRoutingStrategy)
RoutingStrategy
prescribing the fallback approach when this
implementation cannot resolve a routing key.fallbackRoutingStrategy
- the fallback routing to use whenever this RoutingStrategy
doesn't succeedpublic String getRoutingKey(CommandMessage<?> command)
RoutingStrategy
command
. Commands that should be handled by the same segment,
should result in the same routing key.getRoutingKey
in interface RoutingStrategy
command
- the command to create a routing key forprotected abstract String doResolveRoutingKey(CommandMessage<?> command)
command
.command
- the command to resolve the routing key fornull
if unresolvedCopyright © 2010–2022. All rights reserved.