This is part of a series of small blog posts which will cover some of the smaller, perhaps less likely to be noticed, features of IBM MQ. Read other posts in this series.
The feature I want to write about today is something I had almost forgotten existed until a situation that needed came up and them I dredged it from the depths of my brain. So if I had almost forgotten about it, it's time to give it a boost in case others have also forgotten about it.
Imagine a setup where you have some queue managers in an MQ Cluster, and you are also using multi-instance queue managers to ensure each individual queue manager has the best availability possible. Perhaps also your multi-instance queue manager has the possibility to be moved by a DR operation to another machine (or two). So, you find that your CONNAME has a long comma-separated list of IP addresses (and port numbers).
ALTER CHANNEL(TO.MQG1) CHLTYPE(CLUSRCVR) CONNAME('192.168.1.98(1701),192.168.1.99(1701),192.168.2.98(1701),192.168.2.99(1701)')
There are a couple of downsides to doing this, which today's subject feature helps with.
- In order to find the correct IP address in the comma-separated list provided in the CONNAME, the channel has to try each one in turn until one works.
- If one (or more) of the queue manager's in the MQ cluster is a z/OS queue manager, this comma-separated list must fit into 48 characters or it will be truncated and the latter members of the list will simply not exist on the CLUSSDR on z/OS. This requires making and using some very short DNS names and ensuring that they are available everywhere.
There is good news though, as there is an alternative. On the distributed platforms, you can use an often forgotten feature that allows you to set up your CONNAME like this:
ALTER CHANNEL(TO.MQG1) CHLTYPE(CLUSRCVR) CONNAME('(1701)')
Specifically there is no IP address or hostname there at all, just the port number in its usual brackets. When a CONNAME on a CLUSRCVR channel has this format, the queue manager will discover what the current machine IP address is and fill it in and publish it to the full repository to propagate round the cluster.
This means that if your queue manager starts up on a different machine, due to some form of failover, the new location of this queue manager is automatically published round the cluster for all members to use. This feature was originally designed to handle DHCP IP addresses, but works just as well for any type of setup when the IP address of the machine changes for some reason.
#Little-Gem
#IBMMQ
#IBMChampion