Performing scheduled actions is not the primary architectural purpose of the Datapower SOA Appliances, but sometimes it might come in handy to be able to perform a certain ‘batch’ task on a scheduled timing.
As an example we take the situation at one of our customers, where a Datapower box is used as a proxy to add a security layer to the calls going to an external party.
Part of this security layer is the addition of a secure code, that must be retrieved with a call to a security server. This code stays typically the same for a long time and is the same for all calls going through the proxy.
To avoid making a call to the security server for each call that goes through the proxy, a scheduler was created that picks up the secure code every 60 seconds and stores the code in a global Datapower variable. The normal proxy calls simply use the value of this global variable to get the secure code.
- First thing we need for a scheduler is the action that will be executed. This action is defined in a processing rule with all the necessary processing actions in it.
- The scheduling itself should be done through an xml manager. On the page of your xml manager, go to the tab ‘Scheduled Processing Policy Rule’ and simply add a new rule with your selected processing rule and the interval in seconds.
As you see, it’s a very easy but limited (only fixed seconds intervals) feature on the Datapower appliance. In a few minutes you can create a simple scheduler, which is often just what you need.
When you need a more advanced scheduling process, you should consider using cron on unix or the task scheduler on windows and send a request to the service on Datapower that you want to schedule.