Author |
Message
|
Bichu |
Posted: Wed Nov 09, 2016 3:21 am Post subject: How to start and stop message flows at particular intervals |
|
|
Centurion
Joined: 16 Oct 2011 Posts: 124 Location: London
|
Hi All,
I have a requirement for a file fetch from a directory that will be delivered only once in a week. So I designed a message flow which will trigger an input messages to the file read node using MQ input node to read the directory. I thought of writing a cron job which will scan the directory and if file is present, it will trigger a message to the queue listened by the mq input node using amqsput command.
how can i start or stop the message flow only at periodic intervals or when some other criteria meets. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Nov 09, 2016 5:40 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Why send the message on a cron job? Why not have the sender send the message to the trigger queue when it is done and the file is complete?
In fact why have a file at all? Have the sender send messages instead of a file.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Nov 09, 2016 6:09 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
What happens if the clock on the machine putting the file into that directory is 5 seconds slower than the clock on the machine running the cron job... _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
Bichu |
Posted: Wed Nov 09, 2016 6:58 am Post subject: |
|
|
Centurion
Joined: 16 Oct 2011 Posts: 124 Location: London
|
fjb_saper wrote: |
Why send the message on a cron job? Why not have the sender send the message to the trigger queue when it is done and the file is complete?
In fact why have a file at all? Have the sender send messages instead of a file.  |
The sender dont have an MQ end to send the messages. Hence if the file is present in the directory, IIB needs to pick the message. for which I am using File Read node which in turn needs a dummy message. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Nov 09, 2016 7:11 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Bichu wrote: |
Hence if the file is present in the directory, IIB needs to pick the message. for which I am using File Read node which in turn needs a dummy message. |
Why not a FileInput?
What if the clocks are out of sync as my most worthy associate suggests?
What if the clocks are fine but the weekly process to produce the file runs for 30 minutes longer than it usually does? Or starts late due to some delay in the upstream process? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|