What are best practices concerning scheduling and cancelling deadlines using the DeadlineManager and Quartz?
Context about our application (Spring Boot + Axon + Quartz):
It’s concerning an application with one big Aggregate and two smaller AggregateMembers (no entities).
Currently, deadlines are scheduled in different tracked projections (each scheduling / cancelling deadlines for a specific deadlineName).
I’m trying to move the scheduling/cancelling to the Aggregate or AggregateMembers itself.
Facts about our events & deadlines:
- Events that result in a deadline are applied at multiple places throughout both the Aggregate as the AggregateMember (i.e. by different CommandHandlers)
- Same for Events that result in cancellation of a deadline
- All deadlines are scheduled with a provided scheduleId, sometimes it is an id (of the aggregate), sometimes it’s a generated random UUID.
- Sometimes we use the same scheduleId (aggregateId) for different deadlines (i.e. different deadlineNames).