Monday, July 13, 2015

WSO2 BAM : How to change the scheduled time of a scripts in a toolbox

WSO2 Business Activity Monitor (WSO2BAM) [1] is a fully open source, complete solution for monitor/store a large amount of business related activities and understand business activities within SOA and Cloud deployments.

WSO2 BAM comes with predefined set of toolboxes.

A toolbox consist of several components
1. Stream definitions
2. Analytics scripts
3. Visualizations components

Non of the above 3 components are mandatory.
You can have a toolbox which has only Stream definitions and Analytics scripts but not Visualization components.

In WSO2 BAM, toolbox always get the precedence. Which means if you manually change anything related to any component published via a toolbox. It will be override once the server is restarted.

If you update,
1. Schedule time
This will update the schedule time, and newly update value will be only effective until the next restart. This will not get persisted. Once the server is started, schedule time will have the original value form the toolbox

2. Stream definition
If you change anything related to stream definition, it might cause some consistency issues. When the server is restarted, it will find that there is already a stream definition exist with the given name and the configurations are different. So an error will be logged.

So it is highly discouraged to manually modify the components deployed via a toolbox

The recommended way to change anything associated with a toolbox, is to,
1. Unzip the toolbox.
2. Make the necessary changes.
3. Create a zip the files again.
4. Rename the file as <toolbox_name>.tbox
5. Redeploy the toolbox

So, if you need to change the scheduled time of Service_Statistics_Monitoring Toolbox,
Get a copy of Service_Statistics_Monitoring.tbox file resides in [BAM_HOME]/repository/deployment/server/bam-toolbox directory.

Unzip the file. Open the file Service_Statistics_Monitoring/analytics/

Set the following configuration according to your requirement
analyzers.scripts.script1.cron=0 0/20 * * * ?

Create a zip file and change the name of the file to Service_Statistics_Monitoring.tbox

And redeploy the toolbox.

Now your changes is embed into the toolbox and each time the toolbox is deployed, it will have the modified value.


No comments:

Post a Comment