Class AxonServerAutoConfiguration
java.lang.Object
org.axonframework.springboot.autoconfig.AxonServerAutoConfiguration
- All Implemented Interfaces:
org.springframework.beans.factory.Aware,org.springframework.context.ApplicationContextAware
@AutoConfiguration
@AutoConfigureBefore(AxonAutoConfiguration.class)
@ConditionalOnClass(AxonServerConfiguration.class)
@EnableConfigurationProperties(TagsConfigurationProperties.class)
@ConditionalOnProperty(name="axon.axonserver.enabled",
matchIfMissing=true)
public class AxonServerAutoConfiguration
extends Object
implements org.springframework.context.ApplicationContextAware
Configures Axon Server as implementation for the CommandBus, QueryBus and EventStore.
- Since:
- 4.0
- Author:
- Marc Gathier
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionautoPersistentStreamMessageSourceDefinitionBuilder(PersistentStreamScheduledExecutorBuilder executorBuilder, PersistentStreamMessageSourceFactory psFactory, AxonServerConfiguration axonServerConfiguration) Creates aConfigurerModuleto invoke}invalid @link
{@link EventProcessingConfigurer::usingSubscribingEventProcessorsbackwardsCompatiblePersistentStreamScheduledExecutorBuilder(ScheduledExecutorService persistentStreamScheduler) Creates aPersistentStreamScheduledExecutorBuilderdefaulting to the same givenpersistentStreamScheduleron each invocation.commandLoadFactorProvider(AxonServerConfiguration configuration) eventScheduler(Serializer eventSerializer, AxonServerConnectionManager connectionManager) Creates a bean of typePersistentStreamMessageSourceFactoryif one is not already defined.persistentStreamProcessorsConfigurerModule(EventProcessorProperties processorProperties, AxonServerConfiguration axonServerConfiguration) Creates aConfigurerModuleto configuresequencing policiesfor persistent streams connected tosubscribing event processorswith a dead letter queue.persistentStreamRegistrar(org.springframework.core.env.Environment environment, PersistentStreamScheduledExecutorBuilder executorBuilder) Constructs aPersistentStreamMessageSourceRegistrarto create and register Spring beans for persistent streams.Creates aPersistentStreamScheduledExecutorBuilderthat constructsScheduledExecutorServicesfor each persistent stream.processorInfoConfiguration(EventProcessingConfiguration eventProcessingConfiguration, AxonServerConnectionManager connectionManager, AxonServerConfiguration configuration) voidsetApplicationContext(org.springframework.context.ApplicationContext applicationContext) topologyChangeListenerConfigurerModule(AxonServerConnectionManager platformConnectionManager, List<TopologyChangeListener> changeListeners)
-
Constructor Details
-
AxonServerAutoConfiguration
public AxonServerAutoConfiguration()
-
-
Method Details
-
axonServerConfiguration
-
managedChannelCustomizer
-
routingStrategy
-
commandPriorityCalculator
-
commandLoadFactorProvider
@Bean @ConditionalOnMissingBean public CommandLoadFactorProvider commandLoadFactorProvider(AxonServerConfiguration configuration) -
queryPriorityCalculator
-
queryInvocationErrorHandler
-
targetContextResolver
-
processorInfoConfiguration
@Bean @ConditionalOnMissingClass("org.axonframework.extensions.multitenancy.autoconfig.MultiTenancyAxonServerAutoConfiguration") public EventProcessorInfoConfiguration processorInfoConfiguration(EventProcessingConfiguration eventProcessingConfiguration, AxonServerConnectionManager connectionManager, AxonServerConfiguration configuration) -
eventScheduler
@Bean @ConditionalOnMissingBean @ConditionalOnProperty(name="axon.axonserver.event-store.enabled", matchIfMissing=true) public EventScheduler eventScheduler(@Qualifier("eventSerializer") Serializer eventSerializer, AxonServerConnectionManager connectionManager) -
persistentStreamScheduledExecutorBuilder
@Bean @ConditionalOnMissingBean @ConditionalOnMissingQualifiedBean(beanClass=java.util.concurrent.ScheduledExecutorService.class, qualifier="persistentStreamScheduler") @ConditionalOnProperty(name="axon.axonserver.event-store.enabled", matchIfMissing=true) public PersistentStreamScheduledExecutorBuilder persistentStreamScheduledExecutorBuilder()Creates aPersistentStreamScheduledExecutorBuilderthat constructsScheduledExecutorServicesfor each persistent stream. Defaults to aPersistentStreamScheduledExecutorBuilder.defaultFactory().- Returns:
- The a
PersistentStreamScheduledExecutorBuilderthat constructsScheduledExecutorServicesfor each persistent stream.
-
backwardsCompatiblePersistentStreamScheduledExecutorBuilder
@Bean @ConditionalOnMissingBean @ConditionalOnQualifiedBean(beanClass=java.util.concurrent.ScheduledExecutorService.class, qualifier="persistentStreamScheduler") @ConditionalOnProperty(name="axon.axonserver.event-store.enabled", matchIfMissing=true) public PersistentStreamScheduledExecutorBuilder backwardsCompatiblePersistentStreamScheduledExecutorBuilder(@Qualifier("persistentStreamScheduler") ScheduledExecutorService persistentStreamScheduler) Creates aPersistentStreamScheduledExecutorBuilderdefaulting to the same givenpersistentStreamScheduleron each invocation. This bean-creation method is in place for backwards compatibility with 4.10.0, which defaulted to this behavior based on a bean of typeScheduledExecutorServicewith qualifiedpersistentStreamScheduler. -
persistentStreamRegistrar
@Bean @ConditionalOnProperty(name="axon.axonserver.event-store.enabled", matchIfMissing=true) public PersistentStreamMessageSourceRegistrar persistentStreamRegistrar(org.springframework.core.env.Environment environment, PersistentStreamScheduledExecutorBuilder executorBuilder) Constructs aPersistentStreamMessageSourceRegistrarto create and register Spring beans for persistent streams.- Parameters:
environment- The SpringEnvironment.executorBuilder- ThePersistentStreamScheduledExecutorBuilderused to construct aScheduledExecutorServiceto perform the persistent stream's tasks with.- Returns:
- The
PersistentStreamMessageSourceRegistrarto create and register Spring beans for persistent streams.
-
autoPersistentStreamMessageSourceDefinitionBuilder
@Bean @ConditionalOnProperty(name="axon.axonserver.auto-persistent-streams-enable") public ConfigurerModule autoPersistentStreamMessageSourceDefinitionBuilder(PersistentStreamScheduledExecutorBuilder executorBuilder, PersistentStreamMessageSourceFactory psFactory, AxonServerConfiguration axonServerConfiguration) Creates aConfigurerModuleto invoke}invalid @link
{@link EventProcessingConfigurer::usingSubscribingEventProcessors- Parameters:
executorBuilder- TheScheduledExecutorServicebuilder used during construction of thePersistentStreamMessageSourceDefinition.psFactory- used during construction of thePersistentStreamMessageSourceDefinition.axonServerConfiguration- Contains the persistent stream settings.- Returns:
- A
ConfigurerModuleto configure
-
persistentStreamMessageSourceFactory
@Bean @ConditionalOnMissingBean public PersistentStreamMessageSourceFactory persistentStreamMessageSourceFactory()Creates a bean of typePersistentStreamMessageSourceFactoryif one is not already defined. This factory is used to create instances of thePersistentStreamMessageSourcewith specified configurations.The returned factory creates a new
PersistentStreamMessageSourcewith the following parameters:name: The name of the persistent stream.configuration: The Axon framework configuration.persistentStreamProperties: Properties of the persistent stream.scheduler: TheScheduledExecutorServicefor scheduling tasks.batchSize: The number of events to fetch in a single batch.context: The context in which the persistent stream operates.
- Returns:
- A
PersistentStreamMessageSourceFactorythat constructsPersistentStreamMessageSourceinstances.
-
persistentStreamProcessorsConfigurerModule
@Bean @ConditionalOnProperty(name="axon.axonserver.event-store.enabled", matchIfMissing=true) public ConfigurerModule persistentStreamProcessorsConfigurerModule(EventProcessorProperties processorProperties, AxonServerConfiguration axonServerConfiguration) Creates aConfigurerModuleto configuresequencing policiesfor persistent streams connected tosubscribing event processorswith a dead letter queue.- Parameters:
processorProperties- Contains the configured event processors.axonServerConfiguration- Contains the persistent stream definitions.- Returns:
- A
ConfigurerModuleto configuresequencing policiesfor persistent streams connected tosubscribing event processorswith a dead letter queue.
-
topologyChangeListenerConfigurerModule
@Bean @ConditionalOnBean public ConfigurerModule topologyChangeListenerConfigurerModule(AxonServerConnectionManager platformConnectionManager, List<TopologyChangeListener> changeListeners) -
setApplicationContext
public void setApplicationContext(@Nonnull org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException - Specified by:
setApplicationContextin interfaceorg.springframework.context.ApplicationContextAware- Throws:
org.springframework.beans.BeansException
-