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 » Using MQ Connection pooling with a standalone client

Post new topic  Reply to topic
 Using MQ Connection pooling with a standalone client « View previous topic :: View next topic » 
Author Message
psreddy
PostPosted: Wed Sep 01, 2010 7:49 am    Post subject: Using MQ Connection pooling with a standalone client Reply with quote

Newbie

Joined: 01 Sep 2010
Posts: 2

Hi,
I have a Stand alone application (Which is not using WebSphere Application server or JMS) which uses Websphere MQ 6.0 for connecting to MQ Queue to post messages to send Queue and receives the messages from receive Queue. This application opens Queue connection every time it try to send message to Queue and closes it once the message is posted.

Now I have to implement MQ connection pooling. I did searched the IBM site and found the following API for connection pool implementation.

MQSimpleConnectionManager myConnMan = new MQSimpleConnectionManager();
myConnMan.setActive(MQSimpleConnectionManager.MODE_ACTIVE);
myConnMan.setTimeout(3600000);//millisecs
myConnMan.setMaxConnections(33);
myConnMan.setMaxUnusedConnections(50);
myConnMan.setActive(MQSimpleConnectionManager.MODE_INACTIVE);

And I get the queue manager as follows
MQQueueManager qMgr = new MQQueueManager(getMQQueueManagerName(), mqEnv, myConnMan);
queue = qMgr.accessQueue(getMQQueueName(),qOpenOptions, null, null, null);

I tried to use this API in my stand alone application. But I see there is no improvement in connection creation. i.e I see the same number of connections are created even after the above implementation.

My application can create 10 threads and process the simultaneous requests.

My questions are:
1. Can we implement the MQ connection pooling with stand alone applications using the above MQ API?
2. If not, do we need to implement a separate layer for managing the MQ connection pooling?.

Could experts please shedd some light... Its urgent Please..

Thanks in Advance
psreddy
Back to top
View user's profile Send private message
psreddy
PostPosted: Wed Sep 01, 2010 7:50 am    Post subject: Reply with quote

Newbie

Joined: 01 Sep 2010
Posts: 2

Sorry, forgot to mention, it is a Stand alone java client application.
Back to top
View user's profile Send private message
JLRowe
PostPosted: Wed Sep 01, 2010 8:37 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

What specifically is the problem?

You say that 10 connections are being created, one for each thread. This is exactly how it should behave.

Connection pooling will only help you when threads only need occasional access to MQ, allowing connections to be shared between threads. e.g. 100 threads may only need a pool of 10 connections.

Your app just seems to be kicking off 10 threads that all wait for a message and so connection pooling isnt going to buy you anything apart from slightly more complicated code.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Using MQ Connection pooling with a standalone 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.