MQ

MQ

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only

New in 9.4.2 – Uniform Cluster balancing options for 'microservice' style applications

By Anthony Beardsmore posted Thu March 06, 2025 11:18 AM

  

See also https://www.ibm.com/docs/en/ibm-mq/9.4?topic=instances-application-in-mq-classes-jmsjakarta-messaging

IBM MQ 9.4.2 is now generally available, as usual bringing numerous product enhancements and updates.  I wanted to draw attention a particular addition which which might be important to you if you use (or are considering) Uniform Clusters to balance JMS client applications.

Usually when you connect a Java client application to a uniform cluster, all of the JMSConnection objects created within the JVM process are treated as completely independent ‘instances’.  MQ will try and ensure an even balance of those connections across the pool of queue managers for best workload handling and availability.  This is probably exactly what you want in many cases – for example, these might represent many instances of a Message Driven Bean created within a large application server runtime, in which case it makes sense to spread them out as widely as possible to service the set of input queues across the cluster.

However, in some situations, an application may require that if it creates multiple JMSConnections these will always be routed to the same queue manager.  Such designs might assume implicit ‘affinity’ between connections – for example that a message sent by one connection would always be immediately available for another to receive – which is not valid if those connections are routed to alternative nodes in a cluster.

To facilitate this kind of architecture, we have provided a new option in the JMS client library to indicate that all connections from this JVM should be treated as a single ‘Application instance’.  See the KnowledgeCenter link above for full details, but in brief:

  • Opt in by setting environment variable  AMQ_APP_INSTANCE_MODE=JVM or system property  com.ibm.mq.cfg.jmqi.AppInstanceMode=JVM
  • Bear in mind that because they will share a network connection to the queue manager, all JMSConnections made from within this client must have compatible MQ connection properties (for example, you can’t mix reconnectable and non-reconnectable connections).

Note that as this is a client side change, it is not strictly required that you update the queue manager (server installation) to the latest level to start taking advantage of this option - applications can opt into this behaviour as soon as they move to the IBM MQ 9.4.2 .jar files.  We hope this widens the set of applications which can take advantage of the availability and scaling benefits of Uniform Clusters, and as always I look forward to hearing feedback on how this works for you in your environment – as well any suggestions for further ways to make Uniform Clusters easier for your applications to adopt.


#automation-spotlight
#Featured-area-2-home
0 comments
14 views

Permalink