|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Reading MQ message by a multi-thread Client |
« View previous topic :: View next topic » |
Author |
Message
|
sumking |
Posted: Mon Feb 06, 2006 3:17 am Post subject: Reading MQ message by a multi-thread Client |
|
|
Newbie
Joined: 06 Feb 2006 Posts: 1
|
Hi, I would like to know if it is possible to have a multi-threaded client reading MQ messages from one single Queue? As I would like to minimize the processing time by process multiple meesages at the same time. I have tried write a client, but it seems all the other threads are trying to wait the first thread to complete. Any suggestion??? |
|
Back to top |
|
 |
zpat |
Posted: Mon Feb 06, 2006 3:21 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
It's certainly possible. Each thread needs its own connection handle to the queue manager. |
|
Back to top |
|
 |
wschutz |
Posted: Mon Feb 06, 2006 8:01 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
Quote: |
As I would like to minimize the processing time by process multiple meesages at the same time. |
Didn't we just have this discussion someplace here??? In any case, you can only get 1 MQ message at a time .... _________________ -wayne |
|
Back to top |
|
 |
mvic |
Posted: Mon Feb 06, 2006 2:49 pm Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
wschutz wrote: |
In any case, you can only get 1 MQ message at a time .... |
You can only get one message from each MQGET call. But you can make MQGET calls concurrently on more than one thread at once. The best way to make the threads independent is to call MQCONN on each thread, and use the hConn independently on the thread on which it was created.
There are trade-offs, though. Each hConn in the app is served by a dedicated thread in the queue manager. Each hConn in a client app also has a single TCP/IP connection to the server machine, which lives as long as the hConn (or until a firewall cancels it...)
EDIT: correct quoting |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|