Author |
Message
|
firoj.badsa |
Posted: Fri Apr 08, 2011 11:11 am Post subject: Trigger FileInput node at specific time |
|
|
 Centurion
Joined: 16 Feb 2007 Posts: 104
|
Hi,
My flow starts with a FileInput node, which polls message from a remote directory. All was well, till client came back and asked to do the polling at the midnight only!, but in FileInput node we can provide the polling time difference, We cannot set up a particular time to do the polling.
I was thinking of making 2 cronjobs for start and stop of the flow. Is that the right way? any body can guide us please.
Thanks,
Firoj |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Apr 08, 2011 11:36 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Tell the client to only put the file in it's final location ready for pickup at midnight. |
|
Back to top |
|
 |
firoj.badsa |
Posted: Fri Apr 08, 2011 11:43 am Post subject: |
|
|
 Centurion
Joined: 16 Feb 2007 Posts: 104
|
ha ha... You know there demand never ends! .. it seems to be a big file which will be copied from another directory.. And in broker .. if a polling happens when the copy is in progress ..then the file will be backed out .. so.. it will never be delivered ..
Seems they can make sure only in midnight that the file was copied!
Any disadvantage of using the crontabs? |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Apr 08, 2011 11:49 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
The disadvantage of using the crontabs is that what happens when the file isn't ready until 12:05 am?
Tell them to copy the file into the same directory using a temporary name and then when the file is fully copied then do a rename to the final name.
Renames are very fast and require very little in the way of disk activity. |
|
Back to top |
|
 |
firoj.badsa |
Posted: Fri Apr 08, 2011 11:56 am Post subject: |
|
|
 Centurion
Joined: 16 Feb 2007 Posts: 104
|
Another twist! .. File coming from SAP and they are not able to handle the renaming part.. so they dont want to do the renaming thing.
Actually, if file is not ready in Midnight(12:00) then its there fault(agreed). They want me to run the flow after midnight. and i will stop the flow after 24 hrs(through another script).
what you think? cronjob OK for this?
Thanks,
Firoj |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Apr 08, 2011 12:04 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
They can easily handle the rename, using for example a cronjob.
They just choose not to.
You might want, instead, to use a TimoutNotification node and a FileRead node if you are at 7.0.0.2 at least.
You could also, for example, choose to separate file transfer logic from message broker logic, and put another product in between the partner's final destination and your broker input directory. That would be a more enterprise view of the problem and would allow you to solve it for multiple partners with centralized logic rather than dealing with it at each message flow. |
|
Back to top |
|
 |
firoj.badsa |
Posted: Fri Apr 08, 2011 12:07 pm Post subject: |
|
|
 Centurion
Joined: 16 Feb 2007 Posts: 104
|
Yes, FileRead node was a option.. but the server is a remote FTP server.. and when I checked FileRead node, there was no FTP option for that.. |
|
Back to top |
|
 |
rekarm01 |
Posted: Fri Apr 08, 2011 2:39 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
mqjeff wrote: |
Renames are very fast and require very little in the way of disk activity. |
Moving a file from one directory to another can also be very fast and require very little disk activity, as long as the two directories are in the same filesystem. |
|
Back to top |
|
 |
firoj.badsa |
Posted: Wed Apr 13, 2011 9:54 am Post subject: |
|
|
 Centurion
Joined: 16 Feb 2007 Posts: 104
|
New problem! .. After creating the shell script and adding them to the cronjob .. scripts failed to start.. because root is executing the files entered in cronjob and 'root' is not a member of mqm/mqbrkrs group i guess .. anybody can help!
Thanks,
Firoj |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Apr 13, 2011 9:57 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
change the script to su - <broker admin> |
|
Back to top |
|
 |
smdavies99 |
Posted: Wed Apr 13, 2011 11:49 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
mqjeff wrote: |
change the script to su - <broker admin> |
There is a simple solution...
put the job to start the flow into the user crontab.
1) Login as the user or any user who is in the mqbrkrs group.
2) crontab -e
enjoy _________________ 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 |
|
 |
|