Author |
Message
|
santy |
Posted: Fri Jun 26, 2009 11:36 am Post subject: WMB Code - to poll the UNIX directories after every 2 second |
|
|
Centurion
Joined: 03 Nov 2006 Posts: 141
|
Hi,
Can it be possible to write a WMB (in 6.0) code which will constantly poll the UNIX directories for the nunber of files in it ?
I managed to write the code in Java Compute Node for this, but when I plays the messages, it goes in infinte loop.
So is this possible at all to write such code ?
Need guidance.
Thanks. |
|
Back to top |
|
 |
zpat |
Posted: Fri Jun 26, 2009 11:50 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Don't write IBM's code, upgrade to 6.1 and use FileInput.
If you must code Java - use a suitable function that will monitor for files for you and start the flow on arrival. In fact there was an example of a custom input node that did this way back in a 2001 redbook. SG24-6509-00 |
|
Back to top |
|
 |
santy |
Posted: Fri Jun 26, 2009 12:40 pm Post subject: |
|
|
Centurion
Joined: 03 Nov 2006 Posts: 141
|
The flow is running always in WMB.
I want to make sure that my java code write file to UNIX dir only when the number of files in the dir is 1.
I have written the code for that also, but worried that how can we constantly monitor the UNIX directory through WMB Java code..
I think for that the message flow thread is continuasly running, beacuase I'm getting below exception.
BIP2242E: Message flow 'TESTMSGFLOW' could not be reconfigured because it remained busy for longer than the timeout period of '300000'
A request to reconfigure the message flow 'TESTMSGFLOW' was received but this could not be processed because it remained busy processing a message for longer than the timeout specified.
This can be caused by the timeout being too short considering the complexity of the flow and the size of the messages being processed. In such cases the timeout should be increased. It can also be caused by message flows containing infinite loops. In such cases the SQL should be corrected. |
|
Back to top |
|
 |
broker_new |
Posted: Fri Jun 26, 2009 12:52 pm Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
The message flow should be like this
TimeOutNotificationNode>>>JCN>>>...
Configure the TimeOutNotificationNode to invoke the flow for every two seconds and in place your logic in JCN _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
Vitor |
Posted: Sat Jun 27, 2009 3:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
santy wrote: |
I want to make sure that my java code write file to UNIX dir only when the number of files in the dir is 1. |
Why Java? Why not FileOutput (assuming an upgrade)?
And why only one file? What's the requirement here? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
broker_new |
Posted: Mon Jun 29, 2009 7:19 am Post subject: |
|
|
 Yatiri
Joined: 30 Nov 2006 Posts: 614 Location: Washington DC
|
As santy is still at WMB6.0..he can't use FileOutput.
santy have you found a way to do it...even i had a similar requirement long time back and designed using the TimeOutNotificationNode  _________________ IBM ->Let's build a smarter planet |
|
Back to top |
|
 |
santy |
Posted: Mon Jun 29, 2009 8:52 am Post subject: |
|
|
Centurion
Joined: 03 Nov 2006 Posts: 141
|
Hi broker_new and Vitor,
This problem is solved, I have manipulated the java code itself in such a way that it waits for 2 seconds brore writing the file to UNIX directory.
Thanks. |
|
Back to top |
|
 |
|