Author |
Message
|
gaurav.udgir |
Posted: Tue Jul 14, 2009 7:01 am Post subject: poll a folder from time to time to check for a file |
|
|
Apprentice
Joined: 18 May 2009 Posts: 32
|
Hi All,
I have requirement where I need to poll a system folder after every 10 seconds to check for file. If file is not available then need to throw an exception. If any of you have any idea/ solution for achieving this.
Thank you. |
|
Back to top |
|
 |
jbanoop |
Posted: Tue Jul 14, 2009 8:43 am Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
timeout notification node + Java compute node. |
|
Back to top |
|
 |
WMBDEV1 |
Posted: Wed Jul 15, 2009 2:08 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
jbanoop wrote: |
timeout notification node + Java compute node. |
Or better still use the fileinput node (although yuo have not stated what version of MB you are at so this may require an upgrade). |
|
Back to top |
|
 |
jbanoop |
Posted: Wed Jul 15, 2009 4:59 am Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
Quote: |
Or better still use the fileinput node |
Can it throw an exception / trigger the flow if the file is not present ? and as I remember it, FI node does not have an input terminal or am I missing something ? |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Jul 15, 2009 5:47 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
You are correct in that the FileInput Node DOES NOT have an Input Terminal so it has to be at the start of a flow. _________________ 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 |
|
 |
WMBDEV1 |
Posted: Wed Jul 15, 2009 6:03 am Post subject: |
|
|
Sentinel
Joined: 05 Mar 2009 Posts: 888 Location: UK
|
Ok maybe throwing the exception on the lack of presence of a file is not doable using FI alone...
jbanoop wrote: |
Can it throw an exception / trigger the flow if the file is not present ?
|
but.......
Quote: |
FI node does not have an input terminal or am I missing something ? |
it has a polling interval option so it doesnt need an input terminal so yes, you was missing something here.
Last edited by WMBDEV1 on Wed Jul 15, 2009 6:31 am; edited 1 time in total |
|
Back to top |
|
 |
zpat |
Posted: Wed Jul 15, 2009 6:11 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
FileInput node can look for files at a given polling interval.
It does not need a timer node to drive it. However it is not a failure if the file is not there, since it might be there next time.
WMB is not a system management tool. It is about messages and data being found, rather than alerting if they are not found.
If you are processing this file in WMB and want to alert when it was not found in a given period, you could code the flow that processes the file to generate an additional message to a queue that another flow, using a timer node checked at intervals to make sure things were OK.
Generally these sort of designs indicate a lack of clarity of the requirements - always aim for elegant, simple solutions. |
|
Back to top |
|
 |
jbanoop |
Posted: Wed Jul 15, 2009 7:12 am Post subject: |
|
|
Chevalier
Joined: 17 Sep 2005 Posts: 401 Location: SC
|
Quote: |
it has a polling interval option so it doesnt need an input terminal so yes, you was missing something here |
when i was refering to inpout terminal i was thinking in terms of "if it had an input terminal , it could be triggered by a timeout notification node and made to check the directory. If the file was not present, you could throw an exception".
I guess I have been around long enough to understand that nodes without input terminals will have mechanism(s) to trigger the flow  |
|
Back to top |
|
 |
bhavyabhandari |
Posted: Wed Jul 29, 2009 2:11 am Post subject: |
|
|
Apprentice
Joined: 09 Nov 2006 Posts: 33
|
Hi All,
I have requirement where I need to poll a system folder after every 10 seconds to check for file. And I have to move the same to a folder based on its success or failure.
I am working on MB v6.0 .
I have made use of TimeOut Notification - JCN
But the file is not getting pollled. |
|
Back to top |
|
 |
zpat |
Posted: Wed Jul 29, 2009 2:26 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
That is not a requirement, that is one possible implementation choice.
Learning to distinguish underlying requirements from possible solutions (which may be unsuitable) is key to getting good designs.
So don't keep on about how to do something that is fundamentally not a good idea, but find a better, more elegant, solution.
Any design that relies on files being there or not every few seconds is fundamentally fragile and unreliable.
Make designs event driven, not timer driven, for anything to do with MQ or WMB. |
|
Back to top |
|
 |
|