Universal Messaging 10.3 | Administration Guide | Universal Messaging Enterprise Manager | Administration Using Enterprise Manager | Scheduling | Universal Messaging Scheduling : Store Triggers Example
 
Universal Messaging Scheduling : Store Triggers Example

scheduler myStore {

declare Store myPubChannel("myChannel");
declare Store myPubQueue("myQueue");

/*
Create the channels if they do not exist on the server
*/
initialise{
myPubChannel.createChannel( 0, 0, "P");
myPubQueue.createQueue( 0, 0, "M");
myPubChannel.publish("Data to store in the byte array", "tag info",
"key1=value1:key2=value2" );
myPubQueue.publish("Data to store in the byte array", "tag info",
"key1=value1:key2=value2" );
}

/*
At 4:30 each morning perform maintenance on the stores to release unused space
*/
every 04:30 {
myPubQueue.maintain();
myPubChannel.maintain();
}

/*
Every hour publish an event to the Channel
*/
every 0 {
myPubChannel.publish("Data to store in the byte array", "tag info",
"key1=value1:key2:value2" );
myPubQueue.publish("Data to store in the byte array", "tag info",
"key1=value1:key2:value2" );
}

/*
Every 1/2 hour purge the channels/queue
The purge takes 3 optional parameters
StartEID
EndEID
Filter string

So it could be
myPubChannel.purge(0, 100000);
or
myPubChannel.purge(0, 10000, "key1 = 'value1'");
*/
every 0 {
myPubChannel.purge();
myPubQueue.purge();
}

/*
When the number of events == 10 we purge the channel
*/
when(myPubChannel.numOfEvents == 10){
myPubChannel.purge();
}

/*
When the free space is greater then 60% perform maintenance
*/
when(myPubChannel.freeSpace> 60){
myPubChannel.maintain();
}

/*
When the number of connections on a channel reach 20 log an entry
*/
when(myPubChannel.connections == 20){
Logger.report("Reached 20 connections on the channel");
}

/*
Maintain all channels and queues at midnight every night
*/
every 00:00 {
Store.maintain("*");
}

}