Author |
Message
|
broker_new |
Posted: Tue Jun 17, 2008 1:11 pm Post subject: TimerNodes |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
I have gone through all the documentation in Infocentre...
My requirement is to start a message flow at particular time lets say 14:01 everyday.
After going through the documents i understood that TimeOutNotificationNode should be paired with a TimeOutcontrol node which creates the TimeOutRequest message to TimeOutNotification flow.
thats fine.Correct me if iam wrong.
How does the Flow1 will be invoked as it cannot start itself and create the timeout message for Flow2
Flow1)
MQInput>>>ComputeNode>>>TimeOutControlNode
Flow2)
TimeOutNotificationNode>>>ComputeNode>>>MqOutputNode _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
dcjs |
Posted: Tue Jun 17, 2008 4:52 pm Post subject: |
|
|
Acolyte
Joined: 10 Nov 2006 Posts: 53 Location: IBM Bangalore
|
I made some more research on this and developed two Flows as mentioned previously.
In Flow1,
iam putting a Dummy message where compute node creates the TimeoutRequest message as.
SET OutputLocalEnvironment.TimeoutRequest.Action = 'SET';
SET OutputLocalEnvironment.TimeoutRequest.Identifier= 'Time';
SET OutputLocalEnvironment.TimeoutRequest.StartDate= 'TODAY';
SET OutputLocalEnvironment.TimeoutRequest.StartTime= '20:42:00';
SET OutputLocalEnvironment.TimeoutRequest.Count = 4;
SET OutputLocalEnvironment.TimeoutRequest.Interval = 360;
SET OutputLocalEnvironment.TimeoutRequest.IgnoreMissed=TRUE;
SET OutputLocalEnvironment.TimeoutRequest.AllowOverwrite=TRUE;
It makes the Flow2 to start at 20:42:00 and for every hour it triggers it 4 times.
Its exactly my requirement.
But i want to repeat this process daily.
What parameter i need to set to repeat it daily. _________________ TRY TRY UNTIL U SUCCEED |
|
Back to top |
|
 |
broker_new |
Posted: Tue Jun 17, 2008 5:01 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
I did the same thing and trying to repeat the same process DAILY _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
dcjs |
Posted: Tue Jun 17, 2008 6:06 pm Post subject: |
|
|
Acolyte
Joined: 10 Nov 2006 Posts: 53 Location: IBM Bangalore
|
But we need to put the Dummy message into the First flow everyday to repeat the process.I know we can schedule a cronjob to put the Dummy message into the Flow1 and trigger the process.but is there anyway in Broker to make it happen on dialy basis _________________ TRY TRY UNTIL U SUCCEED |
|
Back to top |
|
 |
broker_new |
Posted: Tue Jun 17, 2008 7:08 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
We have written a script to put an EMPTY message on queue which triggers the TimeOutControlNode Flow which creates the neccessary control information(TimeoutRequest) and process the message at particular time intervals.But Iam not sure whether we can configure the nodes to replace the cronjob task. _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
niraj |
Posted: Wed Jun 18, 2008 12:45 am Post subject: Why do we need timer nodes here... |
|
|
 Newbie
Joined: 30 Apr 2008 Posts: 6 Location: Bangalore
|
It seems that we just want to start a flow at a particular time
The approach we are seem to be following is :
• Have cron put a empty message or flow #1
• Flow #1 will generate events for Flow #2 at a particular time
• Flow #2 will do the actual STUFF
IMHO – this approach should be used ONLY_IF, the start time for Flow #2 is determined at execution time by Flow #1. If that is not the case and the start time for Flow #2 is determined by powers outside it – why don’t we try to start the message Flow #2 ( no timer nodes needed ) from the CRON itself.
Timer nodes could still be used Flow#2, if we had to run something every ‘n’ seconds. |
|
Back to top |
|
 |
broker_new |
Posted: Wed Jun 18, 2008 3:39 am Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
Requirement is like this
Everyday the flow has to start at 12:01...1:01....2:02
So there is no configuration to shcedule Broker to start the flow at particular time DAILY until and unless the Flow is triggered. _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
broker_new |
Posted: Wed Jun 18, 2008 4:41 am Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
I designed the Flow in such a way that there is only one Flow to do this and achieved it.
TimeOutNotificatioNode>>>>>ComputeNode>>>>>>>MQOutputNode
In ComputeNode i Code like this
----------------
DECLARE iHour CHAR EXTRACT(HOUR FROM CURRENT_TIMESTAMP);
DECLARE iMin CHAR EXTRACT(MINUTE FROM CURRENT_TIMESTAMP);
IF(iHour IN(8,9,10,11) AND iMin IN(32,33,34)) THEN
SET OutputRoot.MQMD.StrucId = MQMD_STRUC_ID;
SET OutputRoot.MQMD.Version = MQMD_CURRENT_VERSION;
SET OutputRoot.XMLNSC.Out.a = 'abcd';
RETURN TRUE;
ELSE
RETURN FALSE;
END IF;
I have set the TransactionMode to Yes,Operation Mode to Automatic and TimeInterval as 60 to check for each minute.
Checking for the Hour and Minute at every time interval and processing the message flow. _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
TJParsons |
Posted: Wed Jun 18, 2008 8:28 am Post subject: |
|
|
Newbie
Joined: 19 Jun 2007 Posts: 3 Location: Winchester, UK
|
dcjs wrote: |
But we need to put the Dummy message into the First flow everyday to repeat the process.I know we can schedule a cronjob to put the Dummy message into the Flow1 and trigger the process.but is there anyway in Broker to make it happen on dialy basis |
You can avoid the need to put a message regularly by replacing the initial MQInput with a second TimeOutNotificationNode:
Flow1)
TimeOutNotificationNode>>ComputeNode>>>TimeOutControlNode
Flow2)
TimeOutNotificationNode>>>ComputeNode>>>MqOutputNod
Also note that both sets of nodes can be added to the same flow.
See the following document for more help...
http://www.ibm.com/developerworks/websphere/library/techarticles/0603_schutz/0603_schutz.html#N1035C |
|
Back to top |
|
 |
suraj |
Posted: Wed Jun 18, 2008 9:49 am Post subject: |
|
|
Acolyte
Joined: 31 Jul 2007 Posts: 56
|
I had a same kind of requirement, where i needed to trigger a flow at a particular time of the day, and that too ,only once.
I didnt go with the timer node at all and let the chron job control the timing. This would be easy to implement.
By setting the timeoutnotification tigger at every 60 sec , you making the flow trigger 60*60*24 times a day, when u actually do only 4 useful processing in a day. |
|
Back to top |
|
 |
broker_new |
Posted: Wed Jun 18, 2008 11:54 am Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
By setting the timeoutnotification tigger at every 60 sec , you making the flow trigger 60*60*24 times a day
When you specify 60*60*24 it is going to calculate the time interval from the deployment.But it has to be triggered at particular time (Lets say 12:00).
May be in this BuiltNode they(IBM) would have considered these type of requirements and provided an option for it to specify the time at which start the trigger and whether it has to be repeated DAILY?...............................
I think relying on the cronjob is not the right idea. _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
francoisvdm |
Posted: Fri Jun 27, 2008 3:57 am Post subject: |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
Read http://www-128.ibm.com/developerworks/websphere/library/techarticles/0603_schutz/0603_schutz.html
some good information in there.
The problem for me is that you need a bit of "control" ESQL in the first compute node to make sure you do not SET a time that is in the past. The problem is that the "deploy" or start of the flow can happen any time of day or night (server failure) and therefor the flow needs to check to ensure you do not set a start time that is in the past. This is a mayor pain for me....anybody got a nice "clean" solution using timer nodes (no cron) to set a flow to only run ones a week at specific time?
btw, to avoid many triggers every minute just set timeoutinterval of first notification to 1 hour. _________________ If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.
Francois van der Merwe |
|
Back to top |
|
 |
smdavies99 |
Posted: Fri Jun 27, 2008 6:24 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
[quote]re: I think relying on the cronjob is not the right idea. by Broker _new[/quote]
I would love to hear exactly why a cronjob is not the right idea? There must be hundreds of thousands (if not far more) Unix & Linux systems out there quite happily scheduling timed jobs using 'cron' ( or its counterparts on other O/S's)
Cron is simple and easy to setup and IMHO event scheduling should not be done inside the broker.
I consider event scheduling a different thing to using a timeoutcontrol node to do something every say 10 seconds. This is a periodic event. You don't care if it runs at 23:00:00 or 23:00:09.
Things that need to run once a day or even once an hour at a specified time IMHO should be done by the O/S.
If you use the KISS principle, editing a crontab script is far simpler than creating a lot of ESQL etc. _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
francoisvdm |
Posted: Sun Jun 29, 2008 11:21 pm Post subject: |
|
|
Partisan
Joined: 09 Aug 2001 Posts: 332
|
One reason maybe is because if you move the flow to another environment then you must also remember to move the "cron"...? _________________ If you do not know the answer or you get the urge to answer with "RTFM" or "Search better in this forum", please refrain from doing so, just move on to the next question. Much appreciated.
Francois van der Merwe |
|
Back to top |
|
 |
|