Class LegacySagaAutoConfiguration
Saga-annotated types, ported into axon-legacy.
Registers the SpringSagaLookup that discovers @Saga-annotated beans, and provides an
InMemorySagaStore as a last-resort SagaStore bean. Without any SagaStore component,
SagaConfigurer.forType(...) refuses to build a Saga's
EventHandlingComponent
at all, so a store is a hard requirement, not merely a convenience. Axon Framework 4 hid this same default inside
its SagaConfigurer; here it is an explicit, overridable bean instead.
Activates only when axon-legacy is present on the classpath (evidenced by SagaStore being
loadable). LegacyJpaSagaStoreAutoConfiguration and LegacyJdbcSagaStoreAutoConfiguration run
before this class so their SagaStore beans, when applicable, take precedence over the in-memory
fallback.
- Since:
- 5.4.0
- Author:
- Mateusz Nowak
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionProvides theSagaProcessorConfigurerthat assembles the event processors carrying the discovered Sagas.Provides anInMemorySagaStorewhen no otherSagaStorebean is present.static SpringSagaLookupProvides theSpringSagaLookupthat discovers@Saga-annotated bean definitions and registers aSpringSagaDescriptorfor each of them.
-
Constructor Details
-
LegacySagaAutoConfiguration
public LegacySagaAutoConfiguration()
-
-
Method Details
-
springSagaLookup
Provides theSpringSagaLookupthat discovers@Saga-annotated bean definitions and registers aSpringSagaDescriptorfor each of them.Static, like
InfrastructureAutoConfiguration.messageHandlerLookup(), so it can run as aBeanFactoryPostProcessorbefore other bean definitions in this context are fully processed.- Returns:
- the lookup that discovers
@Saga-annotated beans for later configuration
-
sagaProcessorConfigurer
Provides theSagaProcessorConfigurerthat assembles the event processors carrying the discovered Sagas.Sagas get their own assembly rather than riding the regular
DefaultProcessorModuleFactorypipeline, so that no part of Saga support has to be threaded through the handler discovery every Axon Framework 5 Spring application uses. Droppingaxon-legacytherefore removes Saga support whole.- Returns:
- the enhancer assembling the event processors for discovered Sagas
-
sagaStore
Provides anInMemorySagaStorewhen no otherSagaStorebean is present.This is the final fallback in the precedence chain: a user-defined bean wins over
LegacyJpaSagaStoreAutoConfiguration'sJpaSagaStore, which wins overLegacyJdbcSagaStoreAutoConfiguration'sJdbcSagaStore, which wins over this in-memory store.- Returns:
- an in-memory
SagaStore
-