public static class AnnotationRoutingStrategy.Builder extends Object
AnnotationRoutingStrategy
.
The annotationType
is defaulted to RoutingKey
and the fallbackRoutingStrategy
to UnresolvedRoutingKeyPolicy.RANDOM_KEY
.
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
AnnotationRoutingStrategy.Builder |
annotationType(Class<? extends Annotation> annotationType)
Sets the
annotationType Class searched for by this routing strategy on a CommandMessage to base the routing key on. |
AnnotationRoutingStrategy |
build()
Initializes a
AnnotationRoutingStrategy implementation as specified through this Builder. |
AnnotationRoutingStrategy.Builder |
fallbackRoutingStrategy(RoutingStrategy fallbackRoutingStrategy)
Sets the fallback
RoutingStrategy to use when the intended routing key resolution was unsuccessful. |
protected void |
validate()
Validate whether the fields contained in this Builder as set accordingly.
|
public AnnotationRoutingStrategy.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 AnnotationRoutingStrategy.Builder annotationType(Class<? extends Annotation> annotationType)
annotationType
Class
searched for by this routing strategy on a CommandMessage
to base the routing key on. Defaults to the RoutingKey
annotation.annotationType
- an annotation Class
to search for on a CommandMessage
which contains
the command's routing keypublic AnnotationRoutingStrategy build()
AnnotationRoutingStrategy
implementation as specified through this Builder.AnnotationRoutingStrategy
implementation as specified through this Builderprotected void validate()
AxonConfigurationException
- if one field is asserted to be incorrect according to the Builder's
specificationsCopyright © 2010–2024. All rights reserved.