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 » IBM MQ Java / JMS » Pooling Queue Objects

Post new topic  Reply to topic
 Pooling Queue Objects « View previous topic :: View next topic » 
Author Message
yalmasri
PostPosted: Sat Jul 19, 2008 6:57 am    Post subject: Pooling Queue Objects Reply with quote

Centurion

Joined: 18 Jun 2008
Posts: 110

Hi,

I'm wondering if there is any problem caching the MQQueue objects returned from MQQueueManager.accessQueue(...) and using them in a multi-threaded environment, so instead of each time retrieving the queueManager from the pool, accessing the queue, then getting or putting any messages, I'd pick up the queue object itself and get or put messages on it straight ahead.

Is there anyone who discourages this practice? Any precautions for this like simultaneous access to same queue object or sharing it between threads? Of course any number of MQQueue objects will be retrieved from an equivalent number of different MQQueueManager objects.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Sat Jul 19, 2008 9:00 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Connecting / disconnecting to a QM is much more resource intensive than opening / closing a queue which is much more resource intensive than putting and getting messages.

You get your biggest pay off pooling the connections to the QM. Pooling the queue objects. Well, it might help. But honestly I've never heard of anyone doing it. Typically you open the queue and leave it open while you do all your puts and gets. When you're done, close it. I guess you don't leave it in a pool because its relativily fast to open and close the queues.

Plus open queues take up a lot more memory on the QM than connections to the QM, even if nothing is happening. If all the queues were open in a pool you just drastically increased the memory usage of the QM, for not much benefit.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
yalmasri
PostPosted: Sat Jul 19, 2008 10:58 pm    Post subject: Reply with quote

Centurion

Joined: 18 Jun 2008
Posts: 110

Thanks for the insightful post.

Quote:
Plus open queues take up a lot more memory on the QM than connections to the QM, even if nothing is happening


I can't see how closing the queue will free some memory for the QM; if a freed memory is going to be reserved again the next time accessQueue is called, then I wouldn't consider this as a freed memory.
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 » IBM MQ Java / JMS » Pooling Queue Objects
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.