How can a 'holiday schedule' be built into a scheduled service?

Solution Verified - Updated -

Environment

  • JBoss Enterprise SOA Platform (SOA-P) 5.x
  • JBoss Fuse Service Works (FSW) 6.x

Issue

The user wishes to make a scheduled service, but holidays must be taken into consideration. How can this be done?

Resolution

Perhaps the best way to approach this problem is to allow the cron timer to fire every day (or hour, or whatever the preferred schedule is), then have the first action in your Service pipeline be a custom action that determines if today is a day that should be processed.

Your custom Action could refer to a database table, a configuration file, or even a hard-coded Java class to determine if the day is suitable for processing. We'd also suggest that you should put in some sort of warning mechanism that will print a log message (perhaps at level WARN) when your calendar is nearly ended and it needs refreshed. We have known shops that used an annual calendar, but you don't have to abide by this-- you can stock your holiday store out for as many year as your calendar allows you to predict. Just be sure to put some sort of warning (or entry into your ops calendar) so you remember to refresh this internal calendar before it runs past it's final date.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.

Comments