Service Virtualization

Expand all | Collapse all

Proper way to define an MQ Cluster connection using new connection asset

  • 1.  Proper way to define an MQ Cluster connection using new connection asset

    Posted Apr 11, 2016 12:32 PM

    What is the proper way to define an MQ connection to a cluster of many nodes, our MQ infrastructure has two or more nodes depending on the environment

     

    Using the new connection assets , there is a place for a host name, but don't see how to specify more than one host?

     

    Can we use a comma separated list of host names, or should we have multiple models and each model listen to a  single node/host?

     

    Kevin.Bowman should be able to answer very quickly



  • 2.  Re: Proper way to define an MQ Cluster connection using new connection asset
    Best Answer

    Posted Apr 11, 2016 01:49 PM

    As usual with IBM MQ, you have be careful with terminology.  My understanding of MQ "clustering" is that it's more about load balancing than high-availability failover.  In a load balancing scenario it defeats the purpose if you're connecting to multiple points in the cluster from a single application instance.

     

    I think what you're talking about is called "multi-instance queue manager", and that *is* designed for high-availability failover.  Unfortunately, with IBM MQ's Java client a multi-instance queue manager connection is only supported in JMS Mode.  You cannot use it with IBM MQ Native mode.  Because of reasons, I guess.

     

    If JMS mode works for your purposes, then create a new 'Direct JMS Connection Factory for IBM MQ' asset.  Make sure 'PRO' is enabled, click the '+', and and find the 'Connection Name List' parameter:

    Screen Shot 2016-04-11 at 12.36.35 PM.png

     

    Note that it's currently under the 'Advanced' category, but I think it belongs under 'Connection' and I'll be fixing that soon.

     

    The format of the 'Connection Name List' parameter is 'host(port),host(port),...'.  You will also probably need to *remove* the  standard 'Hostname' and 'Port' fields with their respective trash icons:

    Screen Shot 2016-04-11 at 12.37.38 PM.png

     

    Note that there is currently a bug where the 'Hostname' and 'Port' parameters will be added back in the next time you open the asset editor; I'll be fixing that as well.

     

    There are also two other parameters to be aware of: 'Connection' -> 'Client Reconnect Options', and 'Connection' -> 'Client Reconnect Timeout'.  Their tooltips already give you all the information I know about them.