Author |
Message
|
anilit99 |
Posted: Thu Aug 05, 2010 2:18 am Post subject: Polling a directory |
|
|
 Voyager
Joined: 28 May 2009 Posts: 75 Location: London, UK
|
I think I am trying to re-inventing the wheel here. But here is the deal,
1. Have a directory full of xml files (with different names)
2. Need something to poll the directory every 2 secs or so, and put them in a queue and delete/archive the files after that.
3. Peace.
I believe WMB does give you that functionality. But unfortunately we are not in a position to buy that product(time and money constraints, lets say ! ).
I am running MQ 7.01 on Windows. Is there any way, I can reach step 3 without shelling out a lot of money ?
cheers
Anil. _________________ "I almost care !" |
|
Back to top |
|
 |
zpat |
Posted: Thu Aug 05, 2010 2:55 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
|
Back to top |
|
 |
shashivarungupta |
Posted: Thu Aug 05, 2010 2:57 am Post subject: Re: Polling a directory |
|
|
 Grand Master
Joined: 24 Feb 2009 Posts: 1343 Location: Floating in space on a round rock.
|
anilit99 wrote: |
1. Have a directory full of xml files (with different names)
2. Need something to poll the directory every 2 secs or so, and put them in a queue and delete/archive the files after that.
|
when in your directory there are lots of xml files, then whats the criteria to put them in a queue ?
Do you want all of'em to be put in a queue in one shot and make the directory empty by deleting/archiving ? and whenever new one comes up then put it again ? _________________ *Life will beat you down, you need to decide to fight back or leave it. |
|
Back to top |
|
 |
anilit99 |
Posted: Thu Aug 05, 2010 3:19 am Post subject: |
|
|
 Voyager
Joined: 28 May 2009 Posts: 75 Location: London, UK
|
@Zpat: thanks for the pointers, the MQFM from CapitalWare looks very good. I tried MA01 pac already, but looks no good to me. The documentation doesnt clearly say much about file inputs.
Quote: |
when in your directory there are lots of xml files, then whats the criteria to put them in a queue ?
Do you want all of'em to be put in a queue in one shot and make the directory empty by deleting/archiving ? and whenever new one comes up then put it again ?
|
@shashivarungupta: There is no criteria as such. I just need all the files as individual messages in the queue. And this is not one off a thing, files do come in regularly, so I need to poll that directory as well.
cheers
Anil _________________ "I almost care !" |
|
Back to top |
|
 |
harish_td |
Posted: Fri Aug 06, 2010 4:15 am Post subject: |
|
|
Master
Joined: 13 Feb 2006 Posts: 236
|
anilit99 wrote: |
The documentation doesnt clearly say much about file inputs. |
Code: |
-F[+]<filename>
Input/output file.
Entire file will be put to the output queue as a single message.
|
You could put together a script like this to recursively call the ma01 support pac to put files to your queue
Code: |
ls *.xml | while read fileNames;
do echo q -o OUTPUT-QUEUE -m QUEUE-MANAGER -F $fileNames;
q -o OUTPUT-QUEUE -m QUEUE-MANAGER -F $fileNames;
done
|
Using the above hack with the incron could be the answer
http://freshmeat.net/projects/incron/ |
|
Back to top |
|
 |
anilit99 |
Posted: Fri Aug 06, 2010 4:57 am Post subject: |
|
|
 Voyager
Joined: 28 May 2009 Posts: 75 Location: London, UK
|
thanks harish_td !!
I am working in windows environment, but I got the idea though !
cheers
Anil. _________________ "I almost care !" |
|
Back to top |
|
 |
RogerLacroix |
Posted: Fri Aug 06, 2010 8:35 am Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
anilit99 wrote: |
the MQFM from CapitalWare looks very good. |
MQFM should do exactly what you want. Simply use the 'Watch' action. You can set the Poll Interval to any value that is greater than 5 seconds (less than 5 seconds may cause too much IO).
Regards,
Roger Lacroix
Capitalware Inc. _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
|