SpringCloudCommandRouter with the RestCapabilityDiscoveryMode@Deprecated @RestController @RequestMapping(value="${axon.distributed.spring-cloud.fallback-url:/message-routing-information}") public class SpringCloudHttpBackupCommandRouter extends SpringCloudCommandRouter
SpringCloudCommandRouter which has a backup mechanism to provide Message Routing
Information for other nodes and to retrieve Message Routing Information from other Axon nodes.
It is annotated with the RestController and contains the GetMapping annotated getLocalMessageRoutingInformation()
function to have a queryable place to retrieve this node its Message Routing Information. The default endpoint for
this is "/message-routing-information". To configure this endpoint the "axon.distributed.spring-cloud.fallback-url"
application property should be adjusted.
For retrieving the Message Routing Information from other Axon nodes, it uses a RestTemplate to request Message Routing Information through an override of the SpringCloudHttpBackupCommandRouter#getMessageRoutingInformation(ServiceInstance) function.
| Modifier and Type | Class and Description |
|---|---|
static class |
SpringCloudHttpBackupCommandRouter.Builder
Deprecated.
Builder class to instantiate a
SpringCloudHttpBackupCommandRouter. |
serializer| Modifier | Constructor and Description |
|---|---|
protected |
SpringCloudHttpBackupCommandRouter(SpringCloudHttpBackupCommandRouter.Builder builder)
Deprecated.
Instantiate a
SpringCloudHttpBackupCommandRouter based on the fields contained in the SpringCloudHttpBackupCommandRouter.Builder. |
| Modifier and Type | Method and Description |
|---|---|
static SpringCloudHttpBackupCommandRouter.Builder |
builder()
Deprecated.
Instantiate a Builder to be able to create a
SpringCloudHttpBackupCommandRouter. |
MessageRoutingInformation |
getLocalMessageRoutingInformation()
Deprecated.
in favor of the
RestCapabilityDiscoveryMode.getLocalMemberCapabilities() method |
buildMember, findDestination, resetLocalMembership, serviceInstanceMetadataContainsMessageRoutingInformation, updateMembership, updateMembershipsprotected SpringCloudHttpBackupCommandRouter(SpringCloudHttpBackupCommandRouter.Builder builder)
SpringCloudHttpBackupCommandRouter based on the fields contained in the SpringCloudHttpBackupCommandRouter.Builder.
Will assert that the RestTemplate is not null and that the messageRoutingInformationEndpoint is not null and empty. This assertion will throw an AxonConfigurationException if either of them asserts to true. All asserts performed by the SpringCloudCommandRouter.Builder are also taken into account with identical consequences.
builder - the SpringCloudHttpBackupCommandRouter.Builder used to instantiate a SpringCloudHttpBackupCommandRouter instancepublic static SpringCloudHttpBackupCommandRouter.Builder 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.
SpringCloudHttpBackupCommandRouter@Deprecated @GetMapping public MessageRoutingInformation getLocalMessageRoutingInformation()
RestCapabilityDiscoveryMode.getLocalMemberCapabilities() methodMessageRoutingInformation, thus the MessageRoutingInformation of the node this
CommandRouter is a part of. Can either be called directly or through a GET operation on the specified messageRoutingInformationEndpoint of this node.MessageRoutingInformation if the node this CommandRouter implementation is part ofCopyright © 2010–2023. All rights reserved.