• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Spring/quartz/ reading excluded holidays from DB(dynamically)

 
Santosh Ramachandrula
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a scenario where

1. I want to trigger a job on all weekdays, not on Saturday/Sunday/Public Holiday like (Memorial Day, Thanks giving Wknd, July 4'th, Jan 1'st etc).

2. I will be saving the holidays(Memorial Day, Thanks giving Wknd etc.) in a DB table that will have holidays for the next 3 years.

3. If the information in DB does not change it is straightforward, if it changes then I will have to restart my App server.

4. With the DB holiday list changing on fly, can I accomplish scheduling the jobs without restarting the app server (clustered environment)?

Please let me know if you need more information
 
Duc Vo
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What about another job to reload the settings from DB running says everyday?
 
Santosh Ramachandrula
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good idea and thank you. Let me work on my test case and see if I can accomplish this.
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about just running the job every weekday (since this is an easy schedule to set up in quartz), and having the first step of the job be to check against the database whether it should run the rest of the job or not?
 
Santosh Ramachandrula
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nathan, You are right and it is one of the solutions that we have. I am researching if I can run the jobs only on non-holidays as I mentioned above with holiday(s) list in DB without having to do manual/code check in the scheduled job.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic