|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Not reconnecting on multi-instance qmgr using connectionList |
« View previous topic :: View next topic » |
Author |
Message
|
Gideon |
Posted: Wed Aug 28, 2013 7:07 pm Post subject: Not reconnecting on multi-instance qmgr using connectionList |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
I wrote a program with a Connection list to test
a multi-instance queue manager
When I did the failover command on the ACTIVE instance,
I got the following message:
Code: |
-bash-4.1$ endmqm -s mqha2
Waiting for queue manager 'mqha2' to end.
Quiesce request accepted. The queue manager will stop when all outstanding work
is complete, permitting switchover to a standby instance.
-bash-4.1$ |
This looked good, I then checked the status and got the
following
Code: |
QMNAME(mqha2) STATUS(Running elsewhere) STANDBY(Permitted)
INSTANCE(btvm1) MODE(Active) |
I checked the status on the now ACTIVE instanc emachine
as well. It showed the same result
All this is good, but the problem is the java client code I wrote:
I get the following error from the code:
Code: |
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ2007: Failed to send a message to destination 'TEST'.
JMS attempted to perform an MQPUT or MQPUT1; however WebSphere MQ reported an error.
Use the linked exception to determine the cause of this error.
Inner exception(s):
com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' (
'MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').
com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009
com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009 |
So the failover broke the connection. I thought the idea
was for the client to seamlessly handle the failover, so
I must have done something incorrect.
The above error was produced from the following code:
Code: |
private static String conList = "10.14.101.196(1414),10.14.101.197(1414)";
private static String channel = "SYSTEM.ADMIN.SVRCONN";
private static String qmgr = "mqha2";
private static String qName = "TEST";
...
JmsFactoryFactory ff = JmsFactoryFactory.getInstance(WMQConstants.WMQ_PROVIDER);
JmsConnectionFactory cf = ff.createConnectionFactory();
cf.setStringProperty(WMQConstants.WMQ_CONNECTION_NAME_LIST, conList);
cf.setStringProperty(WMQConstants.WMQ_CHANNEL, channel);
cf.setIntProperty(WMQConstants.WMQ_CONNECTION_MODE, WMQConstants.WMQ_CM_CLIENT);
cf.setStringProperty(WMQConstants.WMQ_QUEUE_MANAGER, qmgr);
connection = cf.createConnection();
session = connection.createSession(txEnabled ? true : false, Session.AUTO_ACKNOWLEDGE);
queue = session.createQueue(qName);
producer = session.createProducer(queue);
producer.setDeliveryMode(DeliveryMode.PERSISTENT);
connection.start();
...
try {
producer.send(message);
}
catch (JMSException jmsex) { |
So where did I go wrong. Should I not expect the client to handle the failover. Did I not define the conList correctly. Should I handle the error and reconnect ?
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Aug 28, 2013 8:33 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
You did not handle the failover correctly.
Check all options to the endmqm command.
I believe you should have used -s -r
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
Gideon |
Posted: Thu Aug 29, 2013 9:28 am Post subject: |
|
|
Chevalier
Joined: 18 Aug 2009 Posts: 403
|
I checked the option fo rendmqm
Code: |
-s fails over
-r reconnects |
so I decided to use this method, I start both instnaces and display status:
Code: |
-bash-4.1$ dspmq -x -o standby -o status
QMNAME(WQM1) STATUS(Status not available) STANDBY(Not applicable)
QMNAME(mqha2) STATUS(Running) STANDBY(Permitted)
INSTANCE(btvm1) MODE(Active)
INSTANCE(btvm2) MODE(Standby)
-bash-4.1$ |
Then I failover with a endmqm -s -r
Code: |
-bash-4.1$ hostname
btvm1
-bash-4.1$ endmqm -s -r mqha2
Waiting for queue manager 'mqha2' to end.
Quiesce request accepted. The queue manager will stop when all outstanding work
is complete, permitting switchover to a standby instance.
-bash-4.1$
-bash-4.1$ dspmq -x -o standby -o status
QMNAME(WQM1) STATUS(Status not available) STANDBY(Not applicable)
QMNAME(mqha2) STATUS(Running elsewhere) STANDBY(Permitted)
INSTANCE(btvm2) MODE(Active)
-bash-4.1$ |
My java test program was running well, and had sent about 3000 messages, and then it crashed immediately when I did the failover
Code: |
com.ibm.msg.client.jms.DetailedJMSException: JMSWMQ2007: Failed to send a messag
e to destination 'TEST'.
JMS attempted to perform an MQPUT or MQPUT1; however WebSphere MQ reported an er
ror.
Use the linked exception to determine the cause of this error.
Inner exception(s):
com.ibm.mq.MQException: JMSCMQ0001: WebSphere MQ call failed with compcode '2' (
'MQCC_FAILED') reason '2009' ('MQRC_CONNECTION_BROKEN').
com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009
com.ibm.mq.jmqi.JmqiException: CC=2;RC=2009 |
So the client should have reconnected, since I gave it a connectionlist of :
Code: |
private static String conList = "10.14.101.196(1414),10.14.101.197(1414)"; |
and I can connect with this connection list with either server being the active instance.
What should I look for next ?
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Aug 29, 2013 1:11 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Did you also set the reconnection option on the connection factory?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
PeterPotkay |
Posted: Thu Aug 29, 2013 5:54 pm Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|