This document describes how to use the IBM MQ high availability sample amqsphac to test the switchover of a multi-instance queue manager.
This IBM MQ support article describes how to verify that an MQ client application reconnects automatically when a multi-instance queue manager is switched over from an active instance to a standby instance. The setup uses the MQSERVER environment variable with a connectionNameList that lists the active host first and the standby host second, plus the high availability sample amqsphac, which puts messages into a queue and uses Automatic Client Reconnection.
The scenario uses four Linux hosts: Host1 runs the active instance, Host2 runs the standby, Host3 holds the queue manager data and recovery logs, and Host4 runs the MQ client sample. The article shows the commands used to start the instances, check their status with dspmq, run amqsphac, end the queue manager with a switchover, and observe the reconnection events until the sample continues putting messages on the new active instance.
It is a high availability sample supplied with IBM MQ that uses Automatic Client Reconnection to put a message into a queue.
No. The article notes that amqsputc does not use Automatic Client Reconnection.
The MQ client library code attempts the reconnection or new connection strictly in the order of the list, starting with the first host and moving to the next if it is unavailable.
Running endmqm -is QMMI1 on Host1 ends the queue manager and permits switchover to the standby instance.