public static class SpringCloudHttpBackupCommandRouter.Builder extends SpringCloudCommandRouter.Builder
SpringCloudHttpBackupCommandRouter.
The serviceInstanceFilter is defaulted to a Predicate which always returns true, the
ConsistentHashChangeListener to a no-op solution and the messageRoutingInformationEndpoint to
"/message-routing-information". The DiscoveryClient, localServiceInstance of type Registration, the RoutingStrategy, RestTemplate and messageRoutingInformationEndpoint
are hard requirements and as such should be provided.
serializerSupplier| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
SpringCloudHttpBackupCommandRouter |
build()
Initializes a
SpringCloudHttpBackupCommandRouter as specified through this Builder. |
SpringCloudHttpBackupCommandRouter.Builder |
consistentHashChangeListener(org.axonframework.commandhandling.distributed.ConsistentHashChangeListener consistentHashChangeListener)
Sets the
ConsistentHashChangeListener which is notified when a change in membership has
potentially caused a change in the consistent hash. |
SpringCloudHttpBackupCommandRouter.Builder |
contextRootMetadataPropertyName(String contextRootMetadataPropertyName)
Sets a property key to be expected in the
ServiceInstance.getMetadata() returned object, defining the
context root for the given ServiceInstance. |
SpringCloudHttpBackupCommandRouter.Builder |
discoveryClient(org.springframework.cloud.client.discovery.DiscoveryClient discoveryClient)
Sets the
DiscoveryClient used to discovery and notify other nodes. |
SpringCloudHttpBackupCommandRouter.Builder |
enforceHttpDiscovery()
Deprecated.
in favor of using the
SpringCloudCommandRouter in combination with the RestCapabilityDiscoveryMode |
SpringCloudHttpBackupCommandRouter.Builder |
localServiceInstance(org.springframework.cloud.client.serviceregistry.Registration localServiceInstance)
Sets the
Registration, representing the local Service Instance of this application. |
SpringCloudHttpBackupCommandRouter.Builder |
messageRoutingInformationEndpoint(String messageRoutingInformationEndpoint)
Sets the
messageRoutingInformationEndpoint of type String, which is the endpoint where to
retrieve the another nodes message routing information from. |
SpringCloudHttpBackupCommandRouter.Builder |
restTemplate(org.springframework.web.client.RestTemplate restTemplate)
Sets the
RestTemplate used as the backup mechanism to request another member's MessageRoutingInformation with. |
SpringCloudHttpBackupCommandRouter.Builder |
routingStrategy(org.axonframework.commandhandling.distributed.RoutingStrategy routingStrategy)
Sets the
RoutingStrategy used to define the key on which Command Messages are routed to their
respective nodes. |
SpringCloudHttpBackupCommandRouter.Builder |
serializer(org.axonframework.serialization.Serializer serializer)
Sets the
Serializer used to de-/serialize the CommandMessageFilter. |
SpringCloudHttpBackupCommandRouter.Builder |
serviceInstanceFilter(Predicate<org.springframework.cloud.client.ServiceInstance> serviceInstanceFilter)
Sets a
Predicate of generic type ServiceInstance, used to filter out ServiceInstances
from the membership update loop. |
protected void |
validate()
Validate whether the fields contained in this Builder as set accordingly.
|
capabilityDiscoveryModepublic SpringCloudHttpBackupCommandRouter.Builder discoveryClient(org.springframework.cloud.client.discovery.DiscoveryClient discoveryClient)
SpringCloudCommandRouter.BuilderDiscoveryClient used to discovery and notify other nodes. Used to update its own membership
as a CommandRouter and to create its awareness of available nodes to send commands to.discoveryClient in class SpringCloudCommandRouter.BuilderdiscoveryClient - the DiscoveryClient used to discovery and notify other nodespublic SpringCloudHttpBackupCommandRouter.Builder localServiceInstance(org.springframework.cloud.client.serviceregistry.Registration localServiceInstance)
SpringCloudCommandRouter.BuilderRegistration, representing the local Service Instance of this application. Necessary to
differentiate other instances from the local instance to ensure correct message routing.localServiceInstance in class SpringCloudCommandRouter.BuilderlocalServiceInstance - the Registration, representing the local Service Instance of this
applicationpublic SpringCloudHttpBackupCommandRouter.Builder routingStrategy(org.axonframework.commandhandling.distributed.RoutingStrategy routingStrategy)
SpringCloudCommandRouter.BuilderRoutingStrategy used to define the key on which Command Messages are routed to their
respective nodes.routingStrategy in class SpringCloudCommandRouter.BuilderroutingStrategy - the RoutingStrategy used to define the key on which Command Messages are
routed to their respective nodespublic SpringCloudHttpBackupCommandRouter.Builder serviceInstanceFilter(Predicate<org.springframework.cloud.client.ServiceInstance> serviceInstanceFilter)
SpringCloudCommandRouter.BuilderPredicate of generic type ServiceInstance, used to filter out ServiceInstances
from the membership update loop. Defaults to allow all ServiceInstances.serviceInstanceFilter in class SpringCloudCommandRouter.BuilderserviceInstanceFilter - the Predicate of generic type ServiceInstance, used to filter
out ServiceInstances from the membership update looppublic SpringCloudHttpBackupCommandRouter.Builder consistentHashChangeListener(org.axonframework.commandhandling.distributed.ConsistentHashChangeListener consistentHashChangeListener)
SpringCloudCommandRouter.BuilderConsistentHashChangeListener which is notified when a change in membership has
potentially caused a change in the consistent hash. Defaults to a no-op solution.consistentHashChangeListener in class SpringCloudCommandRouter.BuilderconsistentHashChangeListener - the ConsistentHashChangeListener which is notified when a change
in membership has potentially caused a change in the consistent
hashpublic SpringCloudHttpBackupCommandRouter.Builder contextRootMetadataPropertyName(String contextRootMetadataPropertyName)
SpringCloudCommandRouter.BuilderServiceInstance.getMetadata() returned object, defining the
context root for the given ServiceInstance. Will be used to correctly configure the URI of a Member. Will default to null.contextRootMetadataPropertyName in class SpringCloudCommandRouter.BuildercontextRootMetadataPropertyName - the optional metadata property field of a ServiceInstance that
contains the context root path of the service in questionpublic SpringCloudHttpBackupCommandRouter.Builder serializer(org.axonframework.serialization.Serializer serializer)
SpringCloudCommandRouter.BuilderSerializer used to de-/serialize the CommandMessageFilter. It is strongly
recommended to use the XStreamSerializer for this, as the CommandMessageFilter is not set up
to be serialized through Jackson. Defaults to the XStreamSerializer.serializer in class SpringCloudCommandRouter.Builderserializer - a Serializer used to de-/serialize CommandMessageFilterpublic SpringCloudHttpBackupCommandRouter.Builder restTemplate(org.springframework.web.client.RestTemplate restTemplate)
RestTemplate used as the backup mechanism to request another member's MessageRoutingInformation with.restTemplate - the RestTemplate used as the backup mechanism to request another member's MessageRoutingInformation with.public SpringCloudHttpBackupCommandRouter.Builder messageRoutingInformationEndpoint(String messageRoutingInformationEndpoint)
messageRoutingInformationEndpoint of type String, which is the endpoint where to
retrieve the another nodes message routing information from. Defaults to endpoint "/message-routing-information".messageRoutingInformationEndpoint - the endpoint where to retrieve the another nodes message routing
information from@Deprecated public SpringCloudHttpBackupCommandRouter.Builder enforceHttpDiscovery()
SpringCloudCommandRouter in combination with the RestCapabilityDiscoveryModeSpringCloudCommandRouter to be used for retrieving
MessageRoutingInformation. This should be toggled on if the utilized Spring Cloud Discovery mechanism
has an inconsistent metadata update policy on the ServiceInstance, which can lead to inconsistent
MessageRoutingInformation being shared.public SpringCloudHttpBackupCommandRouter build()
SpringCloudHttpBackupCommandRouter as specified through this Builder.build in class SpringCloudCommandRouter.BuilderSpringCloudHttpBackupCommandRouter as specified through this Builderprotected void validate()
SpringCloudCommandRouter.Buildervalidate in class SpringCloudCommandRouter.BuilderCopyright © 2010–2023. All rights reserved.