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 » Holding connections -Best practices? Ideas?

Post new topic  Reply to topic
 Holding connections -Best practices? Ideas? « View previous topic :: View next topic » 
Author Message
JohnRodey
PostPosted: Mon Oct 31, 2005 12:27 pm    Post subject: Holding connections -Best practices? Ideas? Reply with quote

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
View user's profile Send private message
hopsala
PostPosted: Mon Oct 31, 2005 2:31 pm    Post subject: Re: Holding connections -Best practices? Ideas? Reply with quote

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
View user's profile Send private message
RogerLacroix
PostPosted: Mon Oct 31, 2005 8:54 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
JohnRodey
PostPosted: Wed Nov 02, 2005 10:00 am    Post subject: Reply with quote

Centurion

Joined: 13 Apr 2005
Posts: 103

Thanks, I'll look more into connection pooling.


...and no, not using WAS
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 » Holding connections -Best practices? Ideas?
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.