public abstract class AbstractRoutingStrategy extends Object implements RoutingStrategy
Constructor and Description |
---|
AbstractRoutingStrategy(UnresolvedRoutingKeyPolicy unresolvedRoutingKeyPolicy)
Initializes the strategy using given
unresolvedRoutingKeyPolicy prescribing what happens when a
routing key cannot be resolved. |
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 . |
public AbstractRoutingStrategy(UnresolvedRoutingKeyPolicy unresolvedRoutingKeyPolicy)
unresolvedRoutingKeyPolicy
prescribing what happens when a
routing key cannot be resolved.unresolvedRoutingKeyPolicy
- The policy for unresolved routing keys.public 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 unresolved.Copyright © 2010–2018. All rights reserved.