Background:
The continuous delivery release of IBM MQ v9.1.2 introduced a new feature known as Uniform Clusters. Uniform clusters are a specific pattern of an IBM MQ cluster that provides a highly available and horizontally scaled small collection of queue managers. These queue managers are configured almost identically, so that an application can interact with them as a single group. This makes it easier to ensure each queue manager in the cluster is being used, by automatically ensuring application instances are spread evenly across the queue managers. In the uniform cluster, client connections are grouped together based on the application name. Applications that connect to any member of the uniform cluster using the same application name are considered to be equivalent to any other applications using the same application name. The objective of a uniform cluster deployment is that applications can be designed for scale and availability, and can connect to any of the queue managers within the uniform cluster. This removes any dependency on a specific queue manager, resulting in better availability and workload balancing of messaging traffic.
ACE and Uniform clusters:
App Connect Enterprise utilises MQ in many different ways: Most obviously we have MQInput, MQOutput and MQGet message flow nodes which enable message flows to move messages to and from MQ queues, but there are also other message flow nodes which rely on using MQ to store state. For this reason, although it may be tempting to think "ACE is just an example of an application using MQ, so ACE should support the use of MQ Uniform Clusters", there are important details preventing such a succinct statement covering all potential scenarios. Consider these general points:
- ACE is used in some MQ request/reply scenarios, with a design pattern whereby reply messages must be returned back to the same App Connect Enterprise integration server. For example, when ACE is invoked by an inbound HTTP request and then calls out to an endpoint application via MQ, the reply from the MQ application would need to be returned to the correct integration server in order to return information to the HTTP client connection. This kind of design pattern, doesn't work well with an MQ connection that could be moved at any time where there is no function to move messages to follow ACE to the new queue manager, or ensure that any reply messages also go back to the new queue manager. So for situations like this one, MQ Uniform Clusters currently remains an inappropriate choice until such point as further enhancements are made to the product(s).
- We also have the problem of stateful nodes (Aggregation, Sequence, Resequence, Collector and Timeout) which need to access previously stored messages, which will also fail to work if the MQ connection is moved. Whilst in theory it may become possible in future to instruct MQ to move the connection only when there are no live aggregations in flight (for example), for now we recommend not using a uniform cluster to provide queues for these message flow nodes.
- Last but not least, note that Uniform clusters are expected to have IBM MQ applications connecting as client applications, rather than locally bound applications. Locally bound applications are not prevented from connecting to uniform cluster members, but uniform clusters cannot achieve even workload distribution with locally bound applications, because they cannot connect to any other member of the cluster.
To try and help navigate when to use this relatively new technology, IBM MQ have also published a specific page all about Limitations and considerations for uniform clusters.
How to connect ACE to a Uniform cluster using MQ configuration:
So having understood the exceptions above and noted that uniform clusters are not suitable for everyone, there are still some ACE use cases where uniform clusters can be helpful - specifically those related to one-way messaging, where it is absolutely supported to use queues defined on a Uniform Cluster. If you are in this situation then it is possible to configure ACE to utilise a connection to an MQ Uniform cluster , using configuration entirely outside the ACE product - by configuring a CCDT (Client Channel Definition Table), and either the MQCLNTCF environment variable or configuration changes in the mqclient.ini file to control the MQ Client code.
How to connect ACE to a Uniform cluster using ACE configuration:
In Fix pack 10 we have also made it even easier to make these configurations using an ACE interface.
A new Reconnect
option property is provided on the MQEndpoint policy, which enables you to control whether the IBM MQ client automatically attempts to reconnect to the queue manager if the connection is lost. By default, the IBM MQ client's default reconnection strategy is used, modified by using IBM MQ client configuration described above. The Reconnect property is only used for client connections and is ignored for server connections. The property takes the following possible values:
default
(the default) [which corresponds to the MQ option MQCNO_RECONNECT_AS_DEF]
enabled
[which corresponds to the MQ option MQCNO_RECONNECT]
disabled
[which corresponds to the MQ option MQCNO_RECONNECT_DISABLED]
queueManager
[which corresponds to the MQ option MQCNO_RECONNECT_Q_MGR]
These values are passed to the IBM MQ client in the MQCONNX call, for example which is made by an MQInput node at the start of a message flow. The advantage of this configuration approach is that it becomes possible to use different reconnection settings for different deployments to the same integration server which can be configured to utilise different MQEndpoint policies (thus improving the global nature of providing the reconnect setting through an MQ environment variable).
How does connection to a Uniform cluster effect flow behaviour?
Question: If a connection is moved when a message flow is idle (polling on MQGET without receiving a message), does the integration server notice?
Answer: Yes the integration server reconnects to the new queue manager and then continues to poll.
Question: When messages are running through a non-transactional message flow, what happens if the connection is moved part of the way through the flow?
Answer: The flow will continue to operate. Messages which are sent before and after the rebalancing reconnect, may be delivered to different queue managers. This could even be the case for separate message flow node instances in the same flow.
Question: For a transactional message flow, what happens if the connection is moved part of the way through the flow?
Answer: The transaction will be rolled back and an exception is thrown from the next MQ call, and the backed out message will still be on the original queue manager. Once the connection has been re-established, the backed out message will be available to be processed again somewhere (most likely another instance of the application). If you wish, you can catch and ignore the exception mentioned, at which point your message flow may carry on and do more work on the re-established connection, committing only the work after the connection was re-established!
What's next with Uniform Clustering?
Whilst we're very pleased to announce the changes above, which will make ACE much easier to configure to use an MQ Uniform Cluster, we also note there could be further enhancements you would like us to consider to further exploit uniform clusters. For example you might wish to have ACE configuration to enable the setting of MQAPPLNAME in order to distinguish different ACE applications from an MQ rebalancing perspective if you are using an ACE integration server as a multi-tenant process. Another potential future enhancement would be in the situation of ACE applications that use multiple MQ connections against a uniform cluster, to be able to move their connections as a single unit. As usual, if you would like to see these ideas or others like them get implemented, please get in touch through our Early Experience Program to discuss further.