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 » Too many channels open

Post new topic  Reply to topic Goto page Previous  1, 2
 Too many channels open « View previous topic :: View next topic » 
Author Message
Vitor
PostPosted: Thu Nov 29, 2007 4:10 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

niraj.chaudhary wrote:
One more thing, isn't SVRCONN initiated by MQ client? if it is so, then it should be MQ client, who should be closing it?


MQClient isn't a discrete piece of software, it's a series of libraries allowing a client connection to be established by an application. You'll find the same principles in use for database clients on DB2 & Oracle where you're using SQL against a database not running on your local machine.

In each case, there are rules about client connections that naturally vary from software to software. The general principle is "you opened it, you close it". There's no difference (to the server) between a connection that has no data flowing down it because the application has disconnected and a connection that has no data flowing down it because the application is doing something else at the moment. There can be ways to mitigate or housekeep such situations but they're generally non-optimal because the only definitive source of information on the need for the connection is the app that needed it in the first place!

The solution that MQ uses is to impose a limit on connections (as you've discovered). The broad design rational is that once you've hit the resource limit for connections it's better to refuse new ones than close ones that "look" unused to make more room.

Before our more experienced posters jump on me let me repeat that's the broad principle - I know that behaviour on the ground is more subtle than that!
_________________
Honesty is the best policy.
Insanity is the best defence.


Last edited by Vitor on Thu Nov 29, 2007 4:14 am; edited 1 time in total
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Thu Nov 29, 2007 4:11 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You probably need more connections than you think you do, for a JMS App Server MDB - about two or three per instance of the MDB.

So you may just need to get your MQ Admin to increase this.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
bower5932
PostPosted: Thu Nov 29, 2007 5:26 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

You can find some interesting articles on MDBs at developerWorks:

http://www.ibm.com/developerworks/websphere/library/techarticles/0707_titheridge/0707_titheridge.html
http://www.ibm.com/developerworks/websphere/library/techarticles/0709_titheridge/0709_titheridge.html
http://www.ibm.com/developerworks/websphere/library/techarticles/0611_titheridge/0611_titheridge.html

They'll give some insights into how connections are handled which may or may not help your specific problems.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
fjb_saper
PostPosted: Thu Nov 29, 2007 1:33 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

jefflowrey wrote:
You probably need more connections than you think you do, for a JMS App Server MDB - about two or three per instance of the MDB.

So you may just need to get your MQ Admin to increase this.


Usually per inbound MDB with no outbound JMS connections:
connections needed = number of max instances of the MDB + 1.

Note that the same MDB used with a different name (code reusage) and linked to a different or the same queue will count as 2 different MDBs in the previous requirement.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
niraj.chaudhary
PostPosted: Thu Dec 13, 2007 11:40 pm    Post subject: Reply with quote

Novice

Joined: 20 Jun 2007
Posts: 22
Location: UK

I still am facing the same problem. I have not been able to find any API using which I can close the conneciton properly. I did follow some suggestin and my code looks like this right now. ( it's deployed on Weblogic 8.1):

private void putMessage(String msg) throws JMSException, Exception
{
PCK pck = new PCK();

QueueConnection queueConnection = null;
QueueSession queueSession = null;

QueueSender queueSender = null;

try
{
if (queueConnectionFactory != null)
{
queueConnection = queueConnectionFactory.createQueueConnection();
queueSession = queueConnection.createQueueSession(false,Session.AUTO_ACKNOWLEDGE);
queueSender = queueSession.createSender(queue);
Message message = queueSession.createTextMessage(msg);
queueSender.send(message);
RH01Log.log("emw_00570","Message send [com.XXXXX.rbsc.mdb.TsrRbscApiMDB(putMessage())]" ,pck,"");
}
}

catch (JMSException jEx)
{
RH01Log.log("emw_00570","JMSException while sending the message["+jEx.getMessage()+"] [com.XXXXX.rbsc.mdb.TsrRbscApiMDB(putMessage())]" ,pck,"");
Exception ex = jEx.getLinkedException();
if (ex != null)
{
RH01Log.log("emw_00570","Linked Exception["+ex.getMessage()+"] [com.XXXXX.rbsc.mdb.TsrRbscApiMDB(putMessage())]" ,pck,"");
}
throw jEx;
}
catch (Exception e)
{
RH01Log.log("emw_00570","Exception while sending the message["+e.getMessage()+"] [com.XXXXX.rbsc.mdb.TsrRbscApiMDB(putMessage())]" ,pck,"");
throw e;
}
finally
{
try
{
if (queueSender != null)
{
RH01Log.log("emw_00570","Closing Sender [com.XXXXX.rbsc.mdb.TsrRbscApiMDB(putMessage())]" ,pck,"");
queueSender.close();
}
}
catch (JMSException jEx)
{
Exception ex = jEx.getLinkedException();
if (ex != null)
{
RH01Log.log("emw_00570","Linked Exception while closing queueSender["+ex.getMessage()+"] [com.XXXXX.rbsc.mdb.TsrRbscApiMDB(putMessage())]" ,pck,"");
}
throw jEx;
}
catch (Exception e)
{
RH01Log.log("emw_00570","Exception while closing the queueSender["+e.getMessage()+"] [com.XXXXX.rbsc.mdb.TsrRbscApiMDB(putMessage())]" ,pck,"");
throw e;
}

try
{
if (queueSession != null)
{
RH01Log.log("emw_00570","Closing Session [com.XXXXX.rbsc.mdb.TsrRbscApiMDB(putMessage())]" ,pck,"");
queueSession.close();
}
}
catch (JMSException jEx)
{
Exception ex = jEx.getLinkedException();
if (ex != null)
{
RH01Log.log("emw_00570","Linked Exception while closing queueSession["+ex.getMessage()+"] [com.XXXXX.rbsc.mdb.TsrRbscApiMDB(putMessage())]" ,pck,"");
}
throw jEx;
}
catch (Exception e)
{
RH01Log.log("emw_00570","Exception while closing the queueSession["+e.getMessage()+"] [com.XXXXX.rbsc.mdb.TsrRbscApiMDB(putMessage())]" ,pck,"");
throw e;
}

try
{
if (queueConnection != null)
{
RH01Log.log("emw_00570","Closing Connection [com.XXXXX.rbsc.mdb.TsrRbscApiMDB(putMessage())]" ,pck,"");
queueConnection.close();
}
}
catch (JMSException jEx)
{
Exception ex = jEx.getLinkedException();
if (ex != null)
{
RH01Log.log("emw_00570","Linked Exception while closing queueConnection["+ex.getMessage()+"] [com.XXXXX.rbsc.mdb.TsrRbscApiMDB(putMessage())]" ,pck,"");
}
throw jEx;
}
catch (Exception e)
{
RH01Log.log("emw_00570","Exception while closing the queueConnection["+e.getMessage()+"] [com.XXXXX.rbsc.mdb.TsrRbscApiMDB(putMessage())]" ,pck,"");
throw e;
}
}
}



It's part of an MDB, where context look up for queue and queue conneciton factory is done in the create method. Any suggestions??
Back to top
View user's profile Send private message Yahoo Messenger
fjb_saper
PostPosted: Fri Dec 14, 2007 8:21 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

Well if this is part of the onMessage method of the MDB you will need :
2 X max(MDB instances) + 1 connections so 11 connections for 5 MDB instances...

Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
niraj.chaudhary
PostPosted: Sun Dec 16, 2007 10:49 pm    Post subject: Reply with quote

Novice

Joined: 20 Jun 2007
Posts: 22
Location: UK

hi,

In my case i have got 2 mdb's and max instance possible for both of them are 10. So, going by your logic, i should have 41 server connection channels. While I actually have 100 and despite this I am facing this issue. Even load wasn't great.

Any other suggestions!

cheers,
Niraj
Back to top
View user's profile Send private message Yahoo Messenger
fjb_saper
PostPosted: Mon Dec 17, 2007 4:35 am    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20756
Location: LI,NY

WAS settings will influence as well as transactionality.

If you have outbound connection not driven by inbound connections you need to estimate the number of concurrent connections your web app might need... perhaps based on web traffic...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » Too many channels open
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.