Author |
Message
|
divyadam |
Posted: Wed Sep 25, 2019 4:28 pm Post subject: JMS Auto reconnect with CCDT that's has Multiple QManagers |
|
|
Novice
Joined: 03 Oct 2018 Posts: 22
|
our Setup has 2 QMGRs one in each Datacenter. we use CCDT which hasheighst weight to QMGR1. When QMGR1 in DataCenter1 Goes Down apps are not reconnecting.
I tried Another Setup.
Defined 2 QMGRs in each DataCenter; total of 4 Managers and listed all 4 QMGRs in the CCDT. when I shutdown QMGR1 in DataCenter1 apps reconnect with Auto reconnect feature in JAVA JMS. but when I shutdown both QMGRs ( QMGR1 and QMGR2) apps are not connecting to either of the cross datacenter QMGRs(QMGR3 ad QMGR4).
Applogs only shows the Connection failure to QMGR1 in DataCenter1. does any one has similar issue with cross dataCenter connection. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Sep 25, 2019 5:09 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Depends what you allow on your reconnect. If the reconnect is only allowed to the same qmgr your behavior not reconnecting to QM3 and QM4 makes sense.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
hughson |
Posted: Wed Sep 25, 2019 8:03 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
Please can you show us your DEFINE CHANNEL commands that build the CCDT. Specifically what is in the QMNAME parameter for each record.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
divyadam |
Posted: Wed Sep 25, 2019 9:07 pm Post subject: |
|
|
Novice
Joined: 03 Oct 2018 Posts: 22
|
HERE IS THE CCDT definitions
CHANNEL(QMGR1 CHL )
CHLTYPE(CLNTCONN)
AFFINITY(NONE)
CLNTWGHT(49)
COMPHDR(NONE)
CONNAME(<QMGR1 VIP> <PORT>)
DESCR( )
LOCALADDR( )
MAXMSGL(10485760)
QMNAME(ABCD)
SSLCIPH(TLS_RSA_WITHAES_256_CBC_SHA256)
SSLPEER(CN=QMGR1)
TRPTYPE(TCP)
CHANNEL(QMGR2 CHL )
CHLTYPE(CLNTCONN)
AFFINITY(NONE)
CLNTWGHT(49)
COMPHDR(NONE)
CONNAME(<QMGR2 VIP> <PORT>)
DESCR( )
LOCALADDR( )
MAXMSGL(10485760)
QMNAME(ABCD)
SSLCIPH(TLS_RSA_WITHAES_256_CBC_SHA256)
SSLPEER(CN=QMGR2)
TRPTYPE(TCP)
CHANNEL(QMGR3 CHL )
CHLTYPE(CLNTCONN)
AFFINITY(NONE)
CLNTWGHT(1)
COMPHDR(NONE)
CONNAME(<QMGR3 VIP> <PORT>)
DESCR( )
LOCALADDR( )
MAXMSGL(10485760)
QMNAME(ABCD)
SSLCIPH(TLS_RSA_WITHAES_256_CBC_SHA256)
SSLPEER(CN=QMGR3)
TRPTYPE(TCP)
CHANNEL(QMGR4 CHL )
CHLTYPE(CLNTCONN)
AFFINITY(NONE)
CLNTWGHT(1)
COMPHDR(NONE)
CONNAME(<QMGR4 VIP> <PORT>)
DESCR( )
LOCALADDR( )
MAXMSGL(10485760)
QMNAME(ABCD)
SSLCIPH(TLS_RSA_WITHAES_256_CBC_SHA256)
SSLPEER(CN=QMGR4)
TRPTYPE(TCP)
*** the Idea is to have QMGR1 and QMGR2 in datacenter1 are primary andQMGR3 and QMGR4 in DataCenter2 are backup but actively running on DataCenter2. When in issue JMS connections should failover to QMGRs running in DataCenter2. |
|
Back to top |
|
 |
hughson |
Posted: Wed Sep 25, 2019 9:57 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
I have just experimented with the same setup of a CCDT and I see connections going to QMGR3 if both QMGR1 and QMGR2 are unavailable to make connections to. I also see the occasional connection to QMGR3 even when both QMGR1 and QMGR2 are also up, since 1 in 50 connections is able to be sent there. I did this testing with amqsputc which is 'C' application not a Java application. I did not use reconnect.
You did not say which reconnect options you were using. Can we see your connection code in your JMS application so we can understand more fully. I don't think your CCDT is the problem so we need to look at other details now please.
Cheers,
Morag _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
HubertKleinmanns |
Posted: Thu Sep 26, 2019 12:13 am Post subject: |
|
|
 Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
In JMS you have to set the reconnect options with this call
Code: |
MQConnectionFactory.setClientReconnectOptions() |
Possible values are "WMQConstants.WMQ_CLIENT_RECONNECT_Q_MGR" (reconnect to the same QMgr), "WMQConstants.WMQ_CLIENT_RECONNECT" (reconnect to any QMgr) or "WMQConstants.WMQ_CLIENT_RECONNECT_AS_DEF" (reconnect behaviour set by channel attribute).
In addition in the SVRCONN definitions the attribute SHARECNV has to be at least "1". _________________ Regards
Hubert |
|
Back to top |
|
 |
divyadam |
Posted: Thu Sep 26, 2019 4:09 am Post subject: |
|
|
Novice
Joined: 03 Oct 2018 Posts: 22
|
thank you folks. I have a code review with my developer today. will get you more info. |
|
Back to top |
|
 |
divyadam |
Posted: Thu Sep 26, 2019 5:36 am Post subject: |
|
|
Novice
Joined: 03 Oct 2018 Posts: 22
|
Hi HugHson
can you give me the mqscputc options you used to invoke CCDT and man a client connection. |
|
Back to top |
|
 |
HubertKleinmanns |
Posted: Thu Sep 26, 2019 6:15 am Post subject: |
|
|
 Shaman
Joined: 24 Feb 2004 Posts: 732 Location: Germany
|
In a shell (Unix or Windows) just specify these settings:
Windows:
Code: |
set MQCHLLIB=<path to your CCDT file>
set MQCHLTAB=<name of your CCDT file> |
Unix (bash, ksh):
Code: |
export MQCHLLIB=<path to your CCDT file>
export MQCHLTAB=<name of your CCDT file> |
Unix (Bourne shell):
Code: |
MQCHLLIB=<path to your CCDT file>
MQCHLTAB=<name of your CCDT file>
export MQCHLLIB MQCHLTAB |
And dont't forget to unset the MQSERVER setting:
Windows:
Unix:
Then run "amqsputc" or whatever you want. _________________ Regards
Hubert |
|
Back to top |
|
 |
hughson |
Posted: Thu Sep 26, 2019 3:07 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
|
Back to top |
|
 |
divyadam |
Posted: Thu Sep 26, 2019 3:44 pm Post subject: |
|
|
Novice
Joined: 03 Oct 2018 Posts: 22
|
Here is the JMS client code we use
<Resource
CCDTURL="<TAB File with above definition>"
QMGR="ALERTS" TRAN="1" auth="Container"
description="Connection Factory"
factory="com.ibm.mq.jms.MQQueueConnectionFactoryFactory"
name="JMSException/MQConnectionFactoryCCDT"
type="com.ibm.mq.jms.MQQueueConnectionFactory"
/> |
|
Back to top |
|
 |
hughson |
Posted: Thu Sep 26, 2019 4:05 pm Post subject: |
|
|
 Padawan
Joined: 09 May 2013 Posts: 1959 Location: Bay of Plenty, New Zealand
|
Could you show us where you set the reconnect option? _________________ Morag Hughson @MoragHughson
IBM MQ Technical Education Specialist
Get your IBM MQ training here!
MQGem Software |
|
Back to top |
|
 |
divyadam |
Posted: Thu Sep 26, 2019 4:52 pm Post subject: |
|
|
Novice
Joined: 03 Oct 2018 Posts: 22
|
we don't have the reconnect option. was told the QueueConnectionFactory method has default reconnect feature. |
|
Back to top |
|
 |
divyadam |
Posted: Thu Sep 26, 2019 5:22 pm Post subject: |
|
|
Novice
Joined: 03 Oct 2018 Posts: 22
|
HI Yatiri
with "MQConnectionFactory.setClientReconnectOptions()" if I have to use CCDT should I use "WMQConstants.WMQ_CLIENT_RECONNECT_AS_DEF" (reconnect behaviour set by channel attribute)"?
also what does 'int' value with 'options'
I don't want to set "SHARECNV" on ServerConn cahannel cause it would piggy back on the previous connection I believe.
I was JMC connections to be non-persistent. |
|
Back to top |
|
 |
divyadam |
Posted: Thu Sep 26, 2019 5:53 pm Post subject: |
|
|
Novice
Joined: 03 Oct 2018 Posts: 22
|
Also
Application is taking almost 300 seconds to realize the QMGRs in DataCenter1 are down. that's the default OS timeout. we are planning to Implement JMS TCP timeout as one of the java option that would speed up the QMGR down acknowledgement.
Is there an option at MQConnectionFactory that I can make use of to terminate connection initiation earlier and force the JMS connection to do CCDT lookup? |
|
Back to top |
|
 |
|