|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Holding connections -Best practices? Ideas? |
« View previous topic :: View next topic » |
Author |
Message
|
JohnRodey |
Posted: Mon Oct 31, 2005 12:27 pm Post subject: Holding connections -Best practices? Ideas? |
|
|
 Centurion
Joined: 13 Apr 2005 Posts: 103
|
We are using both base java and JMS.
We are trying to improve performance. One issue we have is how to handle connections to MQ.
We have code that provides an abstraction of MQ. Other developers instantiate our object and call ".put()" to place a message on the queue.
Everytime they call .put() our code reconnects to the QM, this is pretty rough on performance. We could alter the code to establish a connection in the constructor and leave the connection open until the object is destoyed. This improves performance, although, we are worried that this may be too many connection open that may not even be being used.
Is there another way of doing this or a happy medium? |
|
Back to top |
|
 |
hopsala |
Posted: Mon Oct 31, 2005 2:31 pm Post subject: Re: Holding connections -Best practices? Ideas? |
|
|
 Guardian
Joined: 24 Sep 2004 Posts: 960
|
JohnRodey wrote: |
We have code that provides an abstraction of MQ. Other developers instantiate our object and call ".put()" to place a message on the queue. |
If I understand you correctly, this object is created once per-code, right? If so, then why:
JohnRodey wrote: |
We could alter the code to establish a connection in the constructor and leave the connection open until the object is destoyed. This improves performance, although, we are worried that this may be too many connection open that may not even be being used. |
Why too many? How many instances do you have running that use this object?
If you search around the site, you'll see that QMs can easily handle hundreds and even thousands of simultaneous (even very active) connection handles, and if coded proprely, this shouldn't be no problem at all.
Important P.S: Are you using WAS by any chance? If you are, there's a connection pooling feature you should look into... What are you using? |
|
Back to top |
|
 |
RogerLacroix |
Posted: Mon Oct 31, 2005 8:54 pm Post subject: |
|
|
 Jedi Knight
Joined: 15 May 2001 Posts: 3264 Location: London, ON Canada
|
Hi John,
Please don't re-invent the wheel. Go look up 'pool' in the WMQ Using Java manual.
You will find that you can implement connection pools for both MQ base Java and JMS/MQ applications.
Regards,
Roger Lacroix _________________ Capitalware: Transforming tomorrow into today.
Connected to MQ!
Twitter |
|
Back to top |
|
 |
JohnRodey |
Posted: Wed Nov 02, 2005 10:00 am Post subject: |
|
|
 Centurion
Joined: 13 Apr 2005 Posts: 103
|
Thanks, I'll look more into connection pooling.
...and no, not using WAS |
|
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
|
|
|
|