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 » Not reconnecting on multi-instance qmgr using connectionList

Post new topic  Reply to topic
 Not reconnecting on multi-instance qmgr using connectionList « View previous topic :: View next topic » 
Author Message
Gideon
PostPosted: Wed Aug 28, 2013 7:07 pm    Post subject: Not reconnecting on multi-instance qmgr using connectionList Reply with quote

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
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Wed Aug 28, 2013 8:33 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Gideon
PostPosted: Thu Aug 29, 2013 9:28 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
fjb_saper
PostPosted: Thu Aug 29, 2013 1:11 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
PeterPotkay
PostPosted: Thu Aug 29, 2013 5:54 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

Does your MQClient app meet all the requirements listed here?
http://pic.dhe.ibm.com/infocenter/wmqv7/v7r5/topic/com.ibm.mq.dev.doc/q017800_copy.htm
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Not reconnecting on multi-instance qmgr using connectionList
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.