Working with MQ cluster queue objects

Active Messaging allows you to use Adaptive Server as a client to communicate with the WebSphere MQ cluster feature. You can use msgsend to send messages to all the cluster queues on any cluster that is connected to a queue manager.

NoteThe msgrecv function does not support remote queue connections.

A cluster can have more than one queue manager hosting an instance of the same queue. For example, two queue managers, named MASTER_MQ1 and SLAVE_MQ1, both host cluster queue CQ1. Both queue managers then join cluster INV_CQ1, resulting in two instances of the CQ1 cluster queue in the cluster INV_CQ1.�

To specify your remote queue manager, use remote_qmgr in your endpoint syntax segment. Ignore this remote_qmgr option if you are sending a message to the cluster queue that holds multiple instances, and you do not care which instance the destination is or do not need to balance the workload between cluster queue instances. In such cases, WebSphere MQ balances the workload on its own:�

If you prefer not to use the default algorithm, define a cluster workload exit. An exit is a feature of WebSphere MQ that is similar to a trigger in a database. For more information on exits and how to define them, see your IBM WebSphere MQ documentation.�

By using clusters with multiple instances of the same queue, you can route a message to any queue manager that hosts a copy of the correct queue. However, this adversely affects users who have multiple messages that need to maintain their sequential integrity. For example, a customer sends the following messages to a vendor:

  1. “Send 100 widgets,” sent at 9:00 a.m.

  2. “Send 50 widgets,” sent at 9:30 a.m.

  3. “Cancel the first request,” sent at 10:00 a.m.

In this example, the messages must maintain the correct sequence for the vendor to know that the final quantity the customer wishes to purchase is 50 widgets (that is, 100 + 50 – 100 = 50). If message 2 were to arrive before message 1, the vendor would erroneously believe the customer wished to purchase 100 widgets.

Users can adress this issue by putting these messages in the same instance by specifying clustQBinding, an option_string type in the msgsend function. The options for clustQBinding are bind, nobind, and default.� For a full description of these options as well as examples, see the reference pages for msgsend.