title: Automatic reconnection from IBM MQ consumer issue
body: <p>Application is connecting to IBM MQ queue and there is a consumer attached to it. But recently, we encountered a situation/failover which we did not think while writing the code. Recently Queue Manager went down for couple of minutes due to some reason and when it got brought back, consumers of our application got detached from queue.</p>
  
  <p>Only way to attach it back was to restart the application again manually. Code snippet looks like this :- </p>
  
  <pre><code>protected void initalizeConnection() {
      try {
          MQQueueConnectionFactory connectionFactory =
              new MQQueueConnectionFactory();
          connectionFactory.setHostName(System.getProperty(IBMMQ_HOSTNAME));
          int port = Integer.parseInt(System.getProperty(IBMMQ_PORT));
          connectionFactory.setPort(port);
          connectionFactory
              .setQueueManager(System.getProperty(IBMMQ_QUEUEMANAGER));
          connectionFactory.setChannel(System.getProperty(IBMMQ_CHANNEL));
  
          // For a connection to a queue manager in client mode
          connectionFactory.setTransportType(CommonConstants.WMQ_CM_CLIENT);
          QueueConnection connection =
              connectionFactory.createQueueConnection();
          connection.start();
  
          Session session =
              connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
          Destination destination =
              session.createQueue(IBM_MQ_SUBC_DESTINATION_NAME_COMPLETE_LOAD);
          MessageConsumer consumer = session.createConsumer(destination);
          consumer.setMessageListener(closedLoadListener);
      } catch (JMSException jmsException) {
          LOG.error("Error in registering consumer with IBM MQ",
              jmsException);
      }
  }
  </code></pre>
  
  <blockquote>
    <p>Question :- I want to know if there is any configuration settings
    which i can put at connectionfactory level or some other way by which
    auto reconnect option is enabled at consumer level ?</p>
  </blockquote>
  
  <p>Note :- I have tried adding following code also </p>
  
  <pre><code>connectionFactory.setClientReconnectOptions(WMQConstants.WMQ_CLIENT_RECONNECT);
  connectionFactory.setClientReconnectTimeout(1200);
  </code></pre>
  
  <p>but unfortunately, this also did not work.</p>