-
Notifications
You must be signed in to change notification settings - Fork 785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[#2843] Make it possible to have multiple instances of the DbScheduler components. #2853
Conversation
…`DbSchedulerDeadlineManager` to take a supplier, in favour of using a static atomic reference. This makes it possible to use multiple of the same kind of component with scheduler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bunch of minor comments, and something I'm curious about.
Why make Supplier
implementations for the deadline manager and event scheduler?
messaging/src/main/java/org/axonframework/deadline/dbscheduler/DbSchedulerDeadlineManager.java
Outdated
Show resolved
Hide resolved
messaging/src/main/java/org/axonframework/deadline/dbscheduler/DbSchedulerDeadlineManager.java
Outdated
Show resolved
Hide resolved
messaging/src/main/java/org/axonframework/deadline/dbscheduler/DbSchedulerDeadlineManager.java
Show resolved
Hide resolved
...in/java/org/axonframework/deadline/dbscheduler/SimpleDbSchedulerDeadlineManagerSupplier.java
Outdated
Show resolved
Hide resolved
...n/java/org/axonframework/eventhandling/scheduling/dbscheduler/DbSchedulerEventScheduler.java
Outdated
Show resolved
Hide resolved
...n/java/org/axonframework/eventhandling/scheduling/dbscheduler/DbSchedulerEventScheduler.java
Outdated
Show resolved
Hide resolved
...n/java/org/axonframework/eventhandling/scheduling/dbscheduler/DbSchedulerEventScheduler.java
Show resolved
Hide resolved
...nframework/eventhandling/scheduling/dbscheduler/SimpleDbSchedulerEventSchedulerSupplier.java
Outdated
Show resolved
Hide resolved
...nframework/eventhandling/scheduling/dbscheduler/SimpleDbSchedulerEventSchedulerSupplier.java
Outdated
Show resolved
Hide resolved
…/DbSchedulerDeadlineManager.java Co-authored-by: Steven van Beelen <steven.vanbeelen@axoniq.io>
…/DbSchedulerDeadlineManager.java Co-authored-by: Steven van Beelen <steven.vanbeelen@axoniq.io>
…ling/dbscheduler/DbSchedulerEventScheduler.java Co-authored-by: Steven van Beelen <steven.vanbeelen@axoniq.io>
…ling/dbscheduler/DbSchedulerEventScheduler.java Co-authored-by: Steven van Beelen <steven.vanbeelen@axoniq.io>
It serves two purposes. It makes it easier to test them without Spring (although we could have used a similar class only in test). It also makes it easier to use them in non-Spring contexts. |
SonarCloud Quality Gate failed.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concerns have been addressed, hence I'm approving this pull request.
Change the static methods on the
DbSchedulerEventScheduler
and theDbSchedulerDeadlineManager
to take a supplier, in favour of using a static atomic reference. This makes it possible to use multiple of the same kind of component with scheduler.Note this will be a breaking change, but only when either used without spring boot, or with customizations. As the break is clear (the methods now need an argument), the components were introduced just in 4.8.0, and the benefits are plenty, I think this should be fine.
Fixes #2843