public static class MetaDataRoutingStrategy.Builder extends Object
AnnotationRoutingStrategy
.
The fallbackRoutingStrategy
to UnresolvedRoutingKeyPolicy.RANDOM_KEY
. The metaDataKey
is
a hard requirements and as such should be provided.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
MetaDataRoutingStrategy |
build()
Initializes a
MetaDataRoutingStrategy implementation as specified through this Builder. |
MetaDataRoutingStrategy.Builder |
fallbackRoutingStrategy(RoutingStrategy fallbackRoutingStrategy)
Sets the fallback
RoutingStrategy to use when the intended routing key resolution was unsuccessful. |
MetaDataRoutingStrategy.Builder |
metaDataKey(String metaDataKey)
Sets the
metaDataKey searched for by this routing strategy on a CommandMessage 's MetaData to base the routing key on. |
protected void |
validate()
Validate whether the fields contained in this Builder as set accordingly.
|
public MetaDataRoutingStrategy.Builder fallbackRoutingStrategy(RoutingStrategy fallbackRoutingStrategy)
RoutingStrategy
to use when the intended routing key resolution was unsuccessful.
Defaults to a UnresolvedRoutingKeyPolicy.RANDOM_KEY
fallbackRoutingStrategy
- a RoutingStrategy
used as the fallback whenever the intended routing
key resolution was unsuccessfulpublic MetaDataRoutingStrategy.Builder metaDataKey(String metaDataKey)
metaDataKey
searched for by this routing strategy on a CommandMessage
's MetaData
to base the routing key on.metaDataKey
- a String
to search for in a CommandMessage
's MetaData
to base the routing key onpublic MetaDataRoutingStrategy build()
MetaDataRoutingStrategy
implementation as specified through this Builder.MetaDataRoutingStrategy
implementation as specified through this Builderprotected void validate()
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2023. All rights reserved.