axon-spring-boot-starter
, Axon will automatically configure the infrastructure components (command bus, event bus, query bus), as well as any component required to run and store aggregates and sagas.@EntityScan
annotation, this autoconfiguration will not happen anymore. If you then wish to use JPA based components from Axon, you will need to make sure the right Entities are registered.org.axonframework.eventhandling.tokenstore
contains the entities necessary for the TokenStore used by Event Processors.org.axonframework.modelling.saga.repository.jpa
contains the entities necessary to persist Sagasorg.axonframework.eventsourcing.eventstore.jpa
contains the entities necessary for the JPA Event Storage engine, when using a relational database as the Event Store.axon-spring-boot-starter
follows general Spring boot convention in structuring the starter. It depends on axon-spring-boot-autoconfigure
which holds concrete implementation of Axon auto-configuration. When Axon Spring Boot application starts up, it looks for a file named spring.factories
in the classpath
. This file is located in the META-INF
directory of axon-spring-boot-autoconfigure
module:AxonServerAutoConfiguration
, AxonAutoConfiguration
, ...AxonServerAutoConfiguration
configures Axon Server as implementation for the Command Bus, Query Bus and Event Store. It will be applied before AxonAutoConfiguration
, and it will be applied only if the org.axonframework.axonserver.connector.AxonServerConfiguration
class is available in the classpath. Axon Server auto configuration can be disabled by setting the axon.axonserver.enabled
property to false
in the .properties
/.yml
file.AxonAutoConfiguration
configures a 'non-axon-server' implementation of Command Bus, Query Bus, Event Store/Event Bus and other Axon components. These components will be initialized only if they are not in the Spring Application context already, eg. @ConditionalOnMissingBean(EventBus.class)
. As AxonAutoConfiguration
will be applied after AxonServerAutoConfiguration
these Axon components will be in the Spring Application Context already, and therefore Axon Server's implementation of Command Bus, Query Bus and Event Store/Event Bus will win.@Configuration
classes.