Class SpringCloudAutoConfiguration
Registers the collaborators the connector needs, after which the service-loaded
SpringCloudConfigurationEnhancer registers the connectors themselves and the framework decorates the
configured CommandBus and QueryBus into their distributed counterparts.
These beans live here rather than in the ConfigurationEnhancer because two concerns only work through Spring.
SpringCloudMemberDiscovery learns about the cluster from the events Spring Cloud Discovery publishes, which
only reach listeners Spring manages, and the two controllers are only mapped as endpoints if Spring MVC knows about
them. The rest follows those two.
Activates when a Spring Cloud DiscoveryClient is available — that is, when the application has chosen a
discovery implementation of its own — and can be switched off with axon.springcloud.enabled=false. As members
reach each other over HTTP through Spring MVC controllers, it also requires a servlet web application; see
SpringCloudAutoConfiguration.NonWebApplicationGuard and SpringCloudAutoConfiguration.ReactiveWebApplicationGuard.
No Spring Cloud Registration is needed: members identify themselves through the capabilities endpoint, so the
connector works the same with discovery implementations that register the application, such as Eureka, and with those
that leave registration to the platform, such as Spring Cloud Kubernetes.
- Since:
- 5.4.0
- Author:
- Allard Buijze, Steven van Beelen
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classThe connector's own beans, registered unlessaxon.springcloud.enabledis set tofalse.static classRejects an application that distributes messages over Spring Cloud without being able to receive any.static classRejects an application that distributes messages over Spring Cloud from a WebFlux stack. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe name of theRestClientbean used to ask other instances for their capabilities.static final StringThe name of theExecutorServicebean discovery rounds, and the capability requests within them, run on.static final StringThe name of theExecutorbean inter-member command and query dispatches run on.static final StringThe name of theExecutorbean the keep-alive writes of subscriptions being answered run on.static final StringThe name of theRestClientbean used to send queries and subscription queries to other members of the cluster.static final StringThe name of theScheduledExecutorServicebean deciding when the deadline of a dispatched query has passed, when a subscription has been silent for too long, and when a subscription being answered is due a keep-alive.static final StringThe name of theRestClientbean used to send commands to other members of the cluster. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionBean creation method for aConfigurationEnhancerthat disables theSpringCloudConfigurationEnhancerwhenaxon.springcloud.enabledis set tofalse.
-
Field Details
-
REST_CLIENT_BEAN
The name of theRestClientbean used to send commands to other members of the cluster.- See Also:
-
QUERY_REST_CLIENT_BEAN
The name of theRestClientbean used to send queries and subscription queries to other members of the cluster.- See Also:
-
CAPABILITIES_REST_CLIENT_BEAN
The name of theRestClientbean used to ask other instances for their capabilities.- See Also:
-
DISPATCH_EXECUTOR_BEAN
The name of theExecutorbean inter-member command and query dispatches run on.- See Also:
-
QUERY_SCHEDULER_BEAN
The name of theScheduledExecutorServicebean deciding when the deadline of a dispatched query has passed, when a subscription has been silent for too long, and when a subscription being answered is due a keep-alive.- See Also:
-
KEEP_ALIVE_EXECUTOR_BEAN
The name of theExecutorbean the keep-alive writes of subscriptions being answered run on.- See Also:
-
DISCOVERY_EXECUTOR_BEAN
The name of theExecutorServicebean discovery rounds, and the capability requests within them, run on.- See Also:
-
-
Constructor Details
-
SpringCloudAutoConfiguration
public SpringCloudAutoConfiguration()
-
-
Method Details
-
disableSpringCloudConfigurationEnhancer
@Bean @ConditionalOnProperty(name="axon.springcloud.enabled", havingValue="false") public ConfigurationEnhancer disableSpringCloudConfigurationEnhancer()Bean creation method for aConfigurationEnhancerthat disables theSpringCloudConfigurationEnhancerwhenaxon.springcloud.enabledis set tofalse.That enhancer is service-loaded, so switching the connector off takes disabling it explicitly rather than withholding a bean. This method sits outside
SpringCloudAutoConfiguration.ConnectorConfigurationso that it is still reached when the property has switched the connector's own beans off.- Returns:
- an enhancer disabling the Spring Cloud configuration enhancer
-