Class LegacyDbSchedulerDeadlineManagerAutoConfiguration
DbSchedulerDeadlineManager when the application has a db-scheduler Scheduler, as
Axon Framework 4's Spring Boot auto-configuration did.
The manager stores deadlines as DbSchedulerBinaryDeadlineDetails, and this configuration provides the
deadlineDetailsTask that executes them, which db-scheduler's own Spring Boot auto-configuration registers
with the scheduler. The manager converts the deadlines with the EventConverter, the counterpart of the event
serializer Axon Framework 4 wired, so that deadlines an Axon Framework 4 application scheduled keep firing. A fired
deadline runs in a unit of work from the configuration's default UnitOfWorkFactory, and is delivered through
the configuration's ScopeAwareProvider, with which the Saga managers register themselves.
The scheduler's lifecycle stays with db-scheduler's auto-configuration, which starts the scheduler as soon as it
creates it, unless db-scheduler.delay-startup-until-context-ready is set. Deadlines that are overdue by then
wait until Axon has started its event processors, as the ScopeAwareProvider only provides the Saga managers
once these are built. Set the property to start the scheduler after Axon instead.
Define a DeadlineManager bean to configure the manager differently, for example with another converter. This
is needed, for example, when running a DeadlineManager in an upgrade scenario with an XStream-based
serializer in Axon Framework 4.
- Since:
- 5.4.0
- Author:
- Jakob Hatzl
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncom.github.kagkarlsson.scheduler.task.Task<DbSchedulerBinaryDeadlineDetails> dbSchedulerDeadlineDetailsTask(org.springframework.context.ApplicationContext context) Creates the task executing the deadlines theDbSchedulerDeadlineManagerstores, unless the application defines aTaskbean named or qualifieddeadlineDetailsTask, as Axon Framework 4 applications overriding this task did.deadlineManager(com.github.kagkarlsson.scheduler.Scheduler scheduler, ScopeAwareProvider scopeAwareProvider, Configuration configuration, EventConverter eventConverter) Creates theDbSchedulerDeadlineManager, unless the application defines its ownDeadlineManager.
-
Constructor Details
-
LegacyDbSchedulerDeadlineManagerAutoConfiguration
public LegacyDbSchedulerDeadlineManagerAutoConfiguration()
-
-
Method Details
-
dbSchedulerDeadlineDetailsTask
@Bean(name="deadlineDetailsTask") @ConditionalOnMissingQualifiedBean(beanClass=com.github.kagkarlsson.scheduler.task.Task.class, qualifier="deadlineDetailsTask") public com.github.kagkarlsson.scheduler.task.Task<DbSchedulerBinaryDeadlineDetails> dbSchedulerDeadlineDetailsTask(org.springframework.context.ApplicationContext context) Creates the task executing the deadlines theDbSchedulerDeadlineManagerstores, unless the application defines aTaskbean named or qualifieddeadlineDetailsTask, as Axon Framework 4 applications overriding this task did. The task resolves the manager when a deadline fires.- Parameters:
context- the application context to resolve theDbSchedulerDeadlineManagerfrom- Returns:
- the task executing deadlines
-
deadlineManager
@Bean @ConditionalOnBean(com.github.kagkarlsson.scheduler.Scheduler.class) @ConditionalOnMissingBean(DeadlineManager.class) public DbSchedulerDeadlineManager deadlineManager(com.github.kagkarlsson.scheduler.Scheduler scheduler, ScopeAwareProvider scopeAwareProvider, Configuration configuration, EventConverter eventConverter) Creates theDbSchedulerDeadlineManager, unless the application defines its ownDeadlineManager. The manager neither starts nor stops the scheduler, as db-scheduler's Spring Boot auto-configuration does.- Parameters:
scheduler- the db-scheduler scheduler storing and firing the deadlinesscopeAwareProvider- the configuration's provider of the components a fired deadline is delivered toconfiguration- the Axon configuration, providing the defaultUnitOfWorkFactory, the factory of the unit of work a fired deadline runs ineventConverter- the converter of the stored deadlines- Returns:
- the db-scheduler deadline manager
-