Class MigrateDeadlineManagerBuilders
- All Implemented Interfaces:
Cloneable
The legacy SimpleDeadlineManager, QuartzDeadlineManager, JobRunrDeadlineManager and
DbSchedulerDeadlineManager keep their Axon Framework 4 builders, except for three parameters that have no
Axon Framework 5 counterpart:
spanFactory(..)is removed, as tracing comes from a decorator around every configuredDeadlineManager;transactionManager(..)is removed, as a fired deadline runs in a unit of work from the requiredunitOfWorkFactory(..), which provides the transaction;serializer(..)is replaced by the requiredconverter(..)on the three persistent managers.
serializer(..) with converter(..) when the
serializer is a default JacksonSerializer, whose stored deadlines a default JacksonConverter reads.
A serializer that a Spring @Bean method receives as a parameter used for nothing else becomes the converter
Axon Framework 5 Spring Boot provides in its place: the "eventSerializer" qualifier an
EventConverter, "messageSerializer" a MessageConverter, and "serializer" or no
qualifier a GeneralConverter, the one converter type Spring resolves without ambiguity. Which serializer that
parameter was is configured elsewhere, so that statement keeps a marker to check the converter against the deadlines
already stored.
It inserts unitOfWorkFactory(..) right after builder() in a Java builder chain when a factory is in
reach: configuration.getComponent(UnitOfWorkFactory.class) on an Axon Framework 4 Configuration
lambda parameter, method parameter or preceding local, which Axon Framework 5's Configuration answers too,
or, in a Spring @Bean method, a UnitOfWorkFactory parameter it adds to the method, which Spring
resolves from the Axon configuration.
Which UnitOfWorkFactory to use elsewhere, and which converter reads what any other serializer stored,
cannot be inferred at the call site, so the recipe leaves a // TODO(axon4to5): marker on the statement that
builds the manager for those. Builder calls of other components with the same method names are left alone. The
recipe is idempotent: a statement that already carries a marker is not marked again.
- Since:
- 5.4.0
- Author:
- Mateusz Nowak
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openrewrite.Recipe
org.openrewrite.Recipe.Builder, org.openrewrite.Recipe.DelegatingRecipe -
Field Summary
Fields inherited from class org.openrewrite.Recipe
contributors, examples, PANIC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.openrewrite.TreeVisitor<?, org.openrewrite.ExecutionContext> Methods inherited from class org.openrewrite.Recipe
addDataTable, aggregateDataTableDescriptors, builder, buildRecipeList, causesAnotherCycle, clone, createRecipeDescriptor, equals, getContributors, getDataTableDescriptors, getDescriptor, getEstimatedEffortPerOccurrence, getExamples, getInstanceName, getInstanceNameSuffix, getJacksonPolymorphicTypeTag, getMaintainers, getName, getRecipeList, getTags, hashCode, maxCycles, noop, onComplete, run, run, run, setContributors, setExamples, validate, validate, validateAll, validateAll, withOptions
-
Constructor Details
-
MigrateDeadlineManagerBuilders
public MigrateDeadlineManagerBuilders()
-
-
Method Details
-
getDisplayName
- Specified by:
getDisplayNamein classorg.openrewrite.Recipe
-
getDescription
- Specified by:
getDescriptionin classorg.openrewrite.Recipe
-
getVisitor
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()- Overrides:
getVisitorin classorg.openrewrite.Recipe
-