Author |
Message
|
technabber |
Posted: Wed Jul 02, 2008 1:03 pm Post subject: multiple message dequeue |
|
|
Newbie
Joined: 02 Jul 2008 Posts: 6
|
Hi,
I am new to MQ and have been having difficulty finding any information on the web about the issues I need to address. I hope someone will be gracious enough to help.
We have a 10,000 message MQ that we are trying to read from. The messages get put on the queue at a very fast rate (it can be filled in less than a minute). We need to read the messages as fast as they get put on, but the com.ibm.mq package seems to take anywhere from 50 to 500 milliseconds to read one message. This isn't fast enough for us.
Is there any way to dequeue multiple messages at one time instead of requesting one message at a time? If not, can you recommend a good way to get messages off the queue in the fastest way possible?
Thank you in advance for your help. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 02, 2008 1:39 pm Post subject: Re: multiple message dequeue |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
technabber wrote: |
Hi,
I am new to MQ and have been having difficulty finding any information on the web about the issues I need to address. I hope someone will be gracious enough to help.
We have a 10,000 message MQ that we are trying to read from. The messages get put on the queue at a very fast rate (it can be filled in less than a minute). We need to read the messages as fast as they get put on, but the com.ibm.mq package seems to take anywhere from 50 to 500 milliseconds to read one message. This isn't fast enough for us.
Is there any way to dequeue multiple messages at one time instead of requesting one message at a time? If not, can you recommend a good way to get messages off the queue in the fastest way possible?
Thank you in advance for your help. |
Run multiple threads, one connection per thread, under transaction control.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
technabber |
Posted: Wed Jul 02, 2008 2:05 pm Post subject: |
|
|
Newbie
Joined: 02 Jul 2008 Posts: 6
|
We had actually thought of that, but hoped there was a better way to do it. Because in our threading, one thread seems to dequeue, but all the others fail with a reason code 2034.
I have no idea what reason code 2034 because I can't find any documentation on reason codes.
How would I implement "transaction control" to ensure each thread gets unique messages? |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 02, 2008 2:16 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
technabber wrote: |
We had actually thought of that, but hoped there was a better way to do it. Because in our threading, one thread seems to dequeue, but all the others fail with a reason code 2034.
I have no idea what reason code 2034 because I can't find any documentation on reason codes.
How would I implement "transaction control" to ensure each thread gets unique messages? |
Quote: |
mqm@myhost:/home/mqm =>mqrc 2034
2034 0x000007f2 MQRC_NO_MSG_UNDER_CURSOR |
Do not use browse.
MQ internals will ensure that the get retrieves a unique message.
Use multiples connections 1 connection per thread.
Use the sync point option in MQBase and the session transacted in JMS, XMS.
Transaction control has nothing to do with ensuring the unique message. It just speeds up the process because it isolates the acknowledgements.
OH and OF COURSE you cannot have message affinity or you need to deal with the necessary controls around message affinity yourself.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
technabber |
Posted: Wed Jul 02, 2008 2:34 pm Post subject: |
|
|
Newbie
Joined: 02 Jul 2008 Posts: 6
|
Thank you for taking the time to respond to my postings and I hate to keep bothering you because of my ignorance about MQ, but...
I don't know what MQBase is, what a sync point is, or what message affinity is (we're not using JMS). Can you point me to some documentation so I can try to learn about these topics? I would be happy to RTFM, but I can't find an FM!
Also, the only example code I found out on the web uses cursors. Is there example code available somewhere that shows how to pull messages out of the queue w/o using cursors?
I apologize for asking such basic questions, but the MQ documentation on the IBM site is piss poor so I must rely on the kindness of those such as yourself to help.
Thank you, thank you. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jul 02, 2008 2:44 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
|
Back to top |
|
 |
technabber |
Posted: Thu Jul 03, 2008 4:36 am Post subject: |
|
|
Newbie
Joined: 02 Jul 2008 Posts: 6
|
I got it working. We're pulling messages off quick as a whip.
Thank you for all your help. |
|
Back to top |
|
 |
zpat |
Posted: Thu Jul 03, 2008 5:01 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
WMQ V7 has client message performance improvements as it "reads ahead". |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Jul 03, 2008 9:12 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
technabber wrote: |
I got it working. We're pulling messages off quick as a whip.
|
What changes did you make? _________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
|