java - Too many mq connections for a server connection channel which are not created by queue -


as per our configuration, have version 8.5.5.11, ibm mq version 7.5.0.3. using 2 channels connect wmq, 1 maxinst set 250 , 1 500. sharecnv set 10 both. have upper limit of making maximum 2000 connections in queue manager end crossing limit after 3-4 days of continuous running of server. after doing analysis can see @ point of time have 120-160 active connections. dis conn command gives shows lot of connections objname, objtype empty , astate "none". these connections made our server ip seems not created queues objtype not queue these connections. these connections keep on growing on period of time , reach our limit of 2000 connections.

can in identifying why these connections getting created , make sure closed normal idle connections. how connection made , closed in application: have abstrack bean class extended mdb's.

@messagedriven(activationconfig = { @activationconfigproperty(propertyname = "acknowledgemode", propertyvalue = "auto-acknowledge"), @activationconfigproperty(propertyname = "destinationtype", propertyvalue = "javax.jms.queue") }) public class trackbeanv2 extends abstractservicebean implements messagelistener {//code} 

the abstrack bean handles creation , closing of connections in following manner:

public abstract class abstractservicebean { @resource(name = "myqcf", type = queueconnectionfactory.class, shareable =     true, description = "reply connection factory") private connectionfactory replycf;   @postconstruct private void postconstruct() {     replyconnection = replycf.createconnection();  }  catch (jmsexception e) {     throw new runtimeexception("failed create jms connection"); }  } @predestroy private void predestroy() { try {     replyconnection.close(); } catch (jmsexception e) {     throw new runtimeexception("failed close jms connection", e); } }  private void sendresponsemessage(string outputmessagetext, string  jmsmessageid , destination replydestination) { textmessage replymessage = null; try {                createsession();         createproducer();     replymessage = createreplymessage(outputmessagetext , jmsmessageid);         sendreply(replymessage, replydestination);       closeproducer();     closesession(); } catch (jmsexception exp) {     handleexception(exp); } } private void createsession() throws jmsexception{ replysession = replyconnection.createsession(true, 0);                   }` private void createproducer() throws jmsexception{                               replyproducer = replysession.createproducer(null);       }  private void closesession() throws jmsexception { if (replysession != null) {     replysession.close(); } }  private void closeproducer() throws jmsexception{ if (replyproducer != null) {                 replyproducer.close();           } }    private void sendreply(textmessage replymessage, destination replydestination) throws jmsexception {     logmessages(replymessage.gettext(), "response message"); replyproducer.send(replydestination, replymessage); } 

an output of below command

echo "dis conn(*) type(*) conname channel objname objtype" | mqsc -e -m qpdc1gc2 -p width=1000 | grep -o '^\w\+:\|\w\+[(][^)]\+[)]' | awk -f '[()]' -v ofs="," 'function printvalues() { if ("channel" in p) { print p["channel"], p["curshcnv"], p["conname"],p["chstada"],p["chstati"],p["lstmsgda"],p["lstmsgti"],p["objname"],p["objtype"],p["astate"],p["appldesc"],p["appltag"] } } /^\w+:/ { printvalues(); delete p; next } { p[$1] = $2 } end { printvalues() }' | grep mychannel  

looks

a.qmgr1.mychannel,,10.217.278.15,,,,,validate_get_01,queue,active,websphere mq channel,websphere mq client java a.qmgr1.mychannel,,10.217.278.15,,,,,,,none,websphere mq channel,websphere mq client java a.qmgr1.mychannel,,10.217.278.15,,,,,,,none,websphere mq channel,websphere mq client java a.qmgr1.mychannel,,10.217.278.15,,,,,,,none,websphere mq channel,websphere mq client java a.qmgr1.mychannel,,10.217.278.15,,,,,,,none,websphere mq channel,websphere mq client java a.qmgr1.mychannel,,10.217.278.15,,,,,,,none,websphere mq channel,websphere mq client java a.qmgr1.mychannel,,10.217.278.15,,,,,validate_get_01,queue,active,websphere mq channel,websphere mq client java a.qmgr1.mychannel,,10.217.278.15,,,,,getdetailsget_01,queue,none,websphere mq channel,websphere mq client java 

this config in qm.ini.

channels: maxchannels=2000 maxactivechannels=2000 

output of command provided in comments: "841dd9580135dc20","a.qmgr1.mychannel","10.217.278.15","","","none","websphere mq channel","websphere mq client java","" "841dd95801b5dc20","a.qmgr1.mychannel","10.217.278.15","getdetailsget_01","queue","active","websphere mq channel","websphere mq client java","mqoo_input_shared,mqoo_browse,mqoo_inquire,mqoo_save_all_context,mqoo_fail_if_quiescing" "841dd958ab2cf820","a.qmgr1.mychannel","10.217.278.15","getdetailsget_01","queue","none","websphere mq channel","websphere mq client java","mqoo_input_shared,mqoo_inquire,mqoo_save_all_context,mqoo_fail_if_quiescing,mqoo_no_read_ahead"

the symptoms point application connections not getting closed properly. have ibm mq administrator background not java development background, based on have posted far appears me attempting close connections properly. more ibm mq classes jms development background can take look. @roger?


the following script display number of channel instances specific channel name. show total shared conversations across channel's instances, number of unique conns, , total number of objects opened conns including conns no objects open. note when ibm mq client process connects queue manager unique conn queue manager created, if process opens object such queue manager, queue, or topic, dis conn display open objects well.

this may observer increase in these numbers on time understand connection/channel leak experiencing.


example output:

./mq-info.ksh mq.channel.name qmgr.name total number of channel instances: 53 total shared conversations: 94 unique conns: 94 objects opened conns:      15 ""      45 "qmgr"     120 "queue" 

note if channel configured sharecnv of @ least 1, value of total shared conversations , unique conns should match.

in example output 15 of shared conversations have no objects open. remaining 70 shared conversations have queue manager open 45 times , queue objects open 120 times.


mq-info.ksh below:

#!/bin/ksh  chl=${1} qmgr=${2} echo "total number of channel instances: $(echo "dis chs(${chl}) all"|runmqsc $qmgr| grep -o '^\w\+:\|\w\+[(][^)]\+[)]' | awk -f '[()]' -v ofs="," 'function printvalues() { if ("channel" in p) { print p["channel"], p["curshcnv"], p["conname"] } } /^\w+:/ { printvalues(); delete p; next } { p[$1] = $2 } end { printvalues() }'|wc -l)" echo "total shared conversations: $(expr $(echo $(echo "dis chs(${chl}) all"|runmqsc $qmgr| grep -o '^\w\+:\|\w\+[(][^)]\+[)]' | awk -f '[()]' -v ofs="," 'function printvalues() { if ("channel" in p) { print p["channel"], p["curshcnv"], p["conname"] } } /^\w+:/ { printvalues(); delete p; next } { p[$1] = $2 } end { printvalues() }'|awk -f, '{print $2}')|sed -e 's/ / + /g'))" echo "unique conns: $(echo "dis conn(*) type(all) where(channel eq ${chl})"|runmqsc $qmgr|grep -o '^\w\+:\|\w\+[(][^)]\+[)]' | awk -f '[()]' -v ofs='","' 'function printvalues() { if ("conn" in p) { print p["conn"], p["channel"], p["conname"], p["objname"], p["objtype"], p["astate"], p["appldesc"], p["appltag"], p["openopts"] } } /^\w+:/ { if (x !~ /yes/) {printvalues()}; x = "no"; delete p; next } { p[$1] = $2 } { if ("openopts" in p) { printvalues() ; delete p["openopts"]; x = "yes"} } end { if (x !~ /yes/) {printvalues()} }'|sed -e 's/^/"/g' -e 's/$/"/g'|awk -f, '{print $1}'|sort -u|wc -l)" echo "objects opened conns:" echo "dis conn(*) type(all) where(channel eq ${chl})"|runmqsc $qmgr|grep -o '^\w\+:\|\w\+[(][^)]\+[)]' | awk -f '[()]' -v ofs='","' 'function printvalues() { if ("conn" in p) { print p["conn"], p["channel"], p["conname"], p["objname"], p["objtype"], p["astate"], p["appldesc"], p["appltag"], p["openopts"] } } /^\w+:/ { if (x !~ /yes/) {printvalues()}; x = "no"; delete p; next } { p[$1] = $2 } { if ("openopts" in p) { printvalues() ; delete p["openopts"]; x = "yes"} } end { if (x !~ /yes/) {printvalues()} }'|sed -e 's/^/"/g' -e 's/$/"/g'|awk -f, '{print $5}'|sort|uniq -c 

Comments

Popular posts from this blog

javascript - Clear button on addentry page doesn't work -

c# - Selenium Authentication Popup preventing driver close or quit -

tensorflow when input_data MNIST_data , zlib.error: Error -3 while decompressing: invalid block type -