|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Pooling Queue Objects |
« View previous topic :: View next topic » |
Author |
Message
|
yalmasri |
Posted: Sat Jul 19, 2008 6:57 am Post subject: Pooling Queue Objects |
|
|
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 |
|
 |
PeterPotkay |
Posted: Sat Jul 19, 2008 9:00 am Post subject: |
|
|
 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 |
|
 |
yalmasri |
Posted: Sat Jul 19, 2008 10:58 pm Post subject: |
|
|
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 |
|
 |
|
|
 |
|
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
|
|
|
|