Author |
Message
|
ak72 |
Posted: Thu Feb 24, 2005 9:02 am Post subject: message from a queue to a file |
|
|
Novice
Joined: 10 Jan 2005 Posts: 13
|
Hi all,
I have a situation in which as soon as a message comes to a queue it has to be stored in to file automatically .
Thanks |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Feb 24, 2005 9:43 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
OK. _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
PGoodhart |
Posted: Thu Feb 24, 2005 9:44 am Post subject: |
|
|
Master
Joined: 17 Jun 2004 Posts: 278 Location: Harrisburg PA
|
What do you want? Yes it is possible, no it isn't something you just turn on, and you should search the site since I know this has been discussed before.... _________________ Patrick Goodhart
MQ Admin/Web Developer/Consultant
WebSphere Application Server Admin |
|
Back to top |
|
 |
ak72 |
Posted: Thu Feb 24, 2005 10:03 am Post subject: |
|
|
Novice
Joined: 10 Jan 2005 Posts: 13
|
Hi all,
Can any one tell me how to do this.
Thanks |
|
Back to top |
|
 |
kevinf2349 |
Posted: Thu Feb 24, 2005 10:16 am Post subject: |
|
|
 Grand Master
Joined: 28 Feb 2003 Posts: 1311 Location: USA
|
ak72
There are several ways to do this, it will depend on your application/business needs. There really isn't sufficient information in your request to be able to answer it fully.
Questions would include:
Do you want a seperate file for each message?
Do you want to overwrite the same file every time a message arrives?
What platforms are you using?
Do you want the disk writting task to start automatically and run until you close it, or do you want the task to end when it gets a 2033 and restart the next time a message arrives?
Do you want the message to stay on the queue or can it be delete once it is written to the file?
You may want to check out some of the threads on here if you are just wanting to keep the messages for potential replay. There are some free utilities around to assist in this area.
Hope this helps |
|
Back to top |
|
 |
ak72 |
Posted: Thu Feb 24, 2005 11:30 am Post subject: |
|
|
Novice
Joined: 10 Jan 2005 Posts: 13
|
Hi kevin,
Thanks for the reply.Yes for each message a seprate file is to be created and the message is to be deleted from the queue. The operating system is windows XP.
Thanks |
|
Back to top |
|
 |
jefflowrey |
Posted: Thu Feb 24, 2005 11:39 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You need to write a program.
Or buy a program. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
RogerLacroix |
Posted: Thu Feb 24, 2005 2:14 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
|
Back to top |
|
 |
zpat |
Posted: Fri Feb 25, 2005 12:05 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
If you want the program to process messages continuously as they arrive simply code it like this (pseudo code):
MQCONN
MQOPEN
loop:
MQGET WAIT, CONVERT, FAIL_IF_QUIESCING, SYNCPOINT
if QUISCE Then goto end
if NO_MSG_AVAILABLE then goto loop
WRITE FILE
MQCOMMIT
goto loop
end:
MQCLOSE
MQDISC
You could do it without syncpointing but this increases reliability - I would not suggest using a product for such a simple purpose. You get far more control by coding your own program.
You really need to tell us more about platform, languages you can use etc. |
|
Back to top |
|
 |
ak72 |
Posted: Wed Mar 02, 2005 9:15 am Post subject: |
|
|
Novice
Joined: 10 Jan 2005 Posts: 13
|
Hi all,
Thanks very much for your help, I will try the way you all explained.
Once again thanks a lot to you all for the help. |
|
Back to top |
|
 |
|