ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » General IBM MQ Support » Reading MQ message by a multi-thread Client

Post new topic  Reply to topic
 Reading MQ message by a multi-thread Client « View previous topic :: View next topic » 
Author Message
sumking
PostPosted: Mon Feb 06, 2006 3:17 am    Post subject: Reading MQ message by a multi-thread Client Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Mon Feb 06, 2006 3:21 am    Post subject: Reply with quote

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
View user's profile Send private message
wschutz
PostPosted: Mon Feb 06, 2006 8:01 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail AIM Address
mvic
PostPosted: Mon Feb 06, 2006 2:49 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » General IBM MQ Support » Reading MQ message by a multi-thread Client
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.