Replies: 2 comments
-
The Spring Boot starter will add one singleton scheduler bean, yes. You can follow the examples in the Readme to set up mutiple schedulers manually: RecurringTask<Void> hourlyTask = Tasks.recurring("my-hourly-task", FixedDelay.ofHours(1))
.execute((inst, ctx) -> {
System.out.println("Executed!");
});
final Scheduler scheduler = Scheduler
.create(dataSource)
.startTasks(hourlyTask)
.threads(5)
.build();
// hourlyTask is automatically scheduled on startup if not already started (i.e. exists in the db)
scheduler.start(); Note that you will need a separate data source per scheduler, or configure it with separate table names. |
Beta Was this translation helpful? Give feedback.
0 replies
-
What is your use case btw? I made an issue and PR for separate pools for high priority tasks, could be of interest perhaps? #704 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I add dependency
It already has a ready-made Scheduler
Please tell me how to set up several Schedulers for different tasks of my project?
Maybe the db-scheduler-spring-boot-starter dependency is not needed in this case? And pure db-scheduler should be used?
PS Sorry for English, I'm not native speaker
Beta Was this translation helpful? Give feedback.
All reactions