Author |
Message
|
girish_tharwani |
Posted: Thu Dec 30, 2010 6:21 am Post subject: two channels per client |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
I noticed this behaviour while doing a POC on MQ7 auto reconnect feature. Just wanted to check if anyone has any explanation for this while I check the documentation.
I have 4-5 qmgrs on remote servers. I created a CLNTCONN to each of these in my CCDT. I used AFFINITY(NONE) and CLNTWGHT(1) on all of these so that client chooses a channel randomly from the table.
I started simple JMS client on my desktop and monitored the number of running SVRCONN channel instances on all qmgrs. What I noticed is that for each client, two SVRCONN channel instances are started on two different qmgrs. One of them is actively used by client to put the messages on the qmgr, other one just stays there in running status without any messages being routed to that qmgr. When I did endmqm -i on the qmgr that had the active channel, instead of using the other passive channel, client started another channel to a different qmgr. Alternatively, when I killed the qmgr with passive channel, nothing happened. Client kept using the active channel without starting the another passive channel.
I tried a variation of above by making one CLNTCONN a preferred channel by setting its CLNTWGHT(0). In that situation, JMSClients created only one channel to this qmgr. When I killed this qmgr, those client failed over to another qmgr. Any clients started thereafter reverted back to two channels behaviour.
Two channel behaviour happens even if I set DefRecon=NO in mqclient.ini so it does not seem to be related to Auto Reconnect feature of MQ |
|
Back to top |
|
 |
shashikanth_in |
Posted: Thu Dec 30, 2010 7:52 am Post subject: Re: two channels per client !!!! |
|
|
Centurion
Joined: 26 Feb 2009 Posts: 123
|
girish_tharwani wrote: |
I started simple JMS client on my desktop and monitored the number of running SVRCONN channel instances on all qmgrs. What I noticed is that for each client, two SVRCONN channel instances are started on two different qmgrs. |
I am bit confused here. Do you mean the client application had connected to different queue managers at the same time?
Did your channel definitions in CCDT file had queue managers mentioned? |
|
Back to top |
|
 |
girish_tharwani |
Posted: Thu Dec 30, 2010 8:38 am Post subject: |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
Sorry.. missed an important piece of info.. I used same name (QMGRP) in the QMNAME field of all channels in the CCDT and while making connection from client, used *QMGRP as qmgr name. This coupled with AFFINITY(NONE) and CLNTWGHT(1) should have caused the client to connect to any one queue mgr at random. Connection was indeed random not in alphabatic order but with the glitch that there were two qmgrs showing running SVRCONN instances instead of one. |
|
Back to top |
|
 |
shashikanth_in |
Posted: Fri Dec 31, 2010 9:01 am Post subject: |
|
|
Centurion
Joined: 26 Feb 2009 Posts: 123
|
As far as I know, MQ JMS maintains two connections to MQ queue manager, the first one gets created when ConnectionFactory.CreateConnection is called and the second one when Connection.CreateSession is called. In this case you are using '*' in the queue manager name, I am suspecting that CreateConnection and CreateSession have established connection to two different queue managers and because of this you are seeing one instance of SVRCONN in two queue managers. |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Dec 31, 2010 11:00 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I suspect this is due to the autoreconnect feature.
Your connection was correctly opened to QM1. For whatever reason this connection failed but did not close (hanging connection). As a result of the autoreconnect feature you then connected to the next available qmgr in your channel list.... Thus you see the channels open on 2 different qmgrs for the application...
Working as designed  _________________ MQ & Broker admin |
|
Back to top |
|
 |
girish_tharwani |
Posted: Fri Dec 31, 2010 8:59 pm Post subject: |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
I also suspected the autoreconnect to be the reason but so I tried with DefRecon=NO. Still the same results.. two connections.. |
|
Back to top |
|
 |
fjb_saper |
Posted: Sat Jan 01, 2011 5:54 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
girish_tharwani wrote: |
I also suspected the autoreconnect to be the reason but so I tried with DefRecon=NO. Still the same results.. two connections.. |
Does the application attempt to reconnect as well on a failed connection, or JMSException?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
girish_tharwani |
Posted: Mon Jan 03, 2011 8:55 am Post subject: |
|
|
 Voyager
Joined: 01 Aug 2001 Posts: 88 Location: Pune, India
|
to fjb_saper:
As I mentioned earlier, even if I set DefRecon=NO in mqclient.ini (ie ask mq not to retry the reconnect automatically), I can still see two running SVRCONN instances. I tried endmqm on qmgr which was not receiving any messages, no impact on client program. But when I tried endmqm the qmgr that was receiving the messages, the client failed with exception MQRC 2009 MQRC_CONNECTION_BROKEN (as expected)
To shashikanth_in:
You are right. I ran my program in debug mode and paused it after ConnectionFactory.CreateConnection. I could see one instance of SVRCONN. Then I allowed the program to run past the Connection.CreateSession statement and I could see the other instance.
But what next.. a PMR with IBM?? |
|
Back to top |
|
 |
mvic |
Posted: Mon Jan 03, 2011 10:46 am Post subject: |
|
|
 Jedi
Joined: 09 Mar 2004 Posts: 2080
|
girish_tharwani wrote: |
But what next.. a PMR with IBM?? |
I'm surprised you didn't open one already. Everything here is guesswork.. presumably IBM can find out a real answer for you. |
|
Back to top |
|
 |
|