Suppose a client has critical applications using IBM® WebSphere® MQ as a messaging system, and needs to upgrade the existing distributed queuing environment to handle new business and ensure high availability. As a part of the upgrade, some of the queue managers in the existing environment will be made part of a cluster, and some will remain standalone. This article describes a Proof-of-Concept design proposed by IBM.
Queue manager alias definitions
Queue manager alias definitions have three uses:
- When sending messages, remapping the queue manager name
- When sending messages, altering or specifying the transmission queue
- When receiving messages, determining whether the local queue manager is the intended destination for those messages
Outbound messages: Remapping the queue manager name
Queue manager alias definitions can be used to remap the queue manager name specified in an MQOPEN call. For example, an MQOPEN call specifies a queue name of APPQ and a queue manager name of EARTH. The destination queue manager has a queue manager alias definition like this:
DEFINE QREMOTE (EARTH) RQMNAME(MARS)
This definition specifies that the queue manager to be used when an application puts messages to queue manager EARTH is MARS. If the local queue manager is EARTH, it puts the messages to the local queue APPQ. If the local queue manager is not called EARTH, then it routes the message to a transmission queue called MARS, by changing the transmission header to say MARS instead of EARTH.
Inbound messages: Determining the destination
A receiving message channel agent (MCA) opens the queue referenced in the transmission header. If a queue manager alias definition exists with the same name as the queue manager referenced, then the queue manager name received in the transmission header is replaced with the RQMNAME from that definition. This mechanism has two uses:
- Direct messages to another queue manager
- Alter the queue manager name to be the same as the local queue manager
Outbound messages: Altering or specifying the transmission queue
Figure 1 shows a scenario in which messages arrive at queue manager QM1 with transmission headers showing queue names at queue manager QM3. QM3 is reachable by multi-hopping through QM2:
All messages for QM3 are captured at QM1 with a queue manager alias named QM3 and containing the definition QM3 via transmission queue QM2. The definition looks like this:
DEFINE QREMOTE (QM3) RNAME(' ') RQMNAME(QM3) XMITQ(QM2)
The queue manager puts the messages on transmission queue QM2, but does not change the transmission queue header, because the name of the destination queue manager, QM3, does not change.
All messages arriving at QM1 and showing a transmission header containing a queue name at QM2 are also put on the QM2 transmission queue. In this way, messages with different destinations are collected onto a common transmission queue to an appropriate adjacent system, for onward transmission to their destinations.
Communicating with queue managers inside the cluster
There are four queue managers in the environment: MERCURY, VENUS, EARTH, and MARS. These queue managers are part of the cluster called PLANETS. APP.LOCAL queue is an application queue defined on all four queue managers. The application called APP1 is connecting to a queue manager JUPITER. The application is putting messages on the remote queue called APP1.REMOTE. The destination queue is the cluster queue APP.LOCAL, hosted on the four queue managers in the cluster. The messages will be load balanced across the queue managers. The queue manager MARS acts as a gateway queue manager. The configuration is shown in Figure 2:
Configuring the queue manager alias
- Create a gateway queue manager named MARS using the following command:
- Add MARS to the cluster PLANETS (partial repos) by creating the
cluster sender and cluster receiver channels to the EARTH queue
DEFINE CHANNEL(TO.MARS) CHLTYPE(CLUSRCVR) CONNAME(’10.7.0.100(1415)’) + CLUSTER(PLANETS) DEFINE CHANNEL(TO.EARTH) CHLTYPE(CLUSSDR) + CONNAME(’10.7.0.112(2222)’) CLUSTER(PLANETS)
- Create bidirectional connectivity between the application queue manager JUPITER and the MARS queue managers.
- Define a remote queue APP1.REMOTE on the JUPITER queue manager with an
RQMNAME of MARS:
DEFINE QR(APP1.REMOTE) RNAME(APP.LOCAL) RQMNAME(PLANETSGW) XMITQ(MARS)
- Define a cluster local queue – APP.LOCAL on the MERCURY, VENUS, and EARTH queue managers.
- Define a queue manager alias on the cluster gateway queue manager
DEFINE QR(PLANETSGW) RNAME(‘ ‘) RQMNAME(‘ ‘)
You have now set up load balancing between the four queue managers using the queue manager alias.
Communicating with queue managers outside the cluster
There are a total of seven queue managers: MERCURY, VENUS, EARTH, MARS, JUPITER, SATURN, and URANUS. These queue managers are not part of any clusters.
The proposed design requires the four queue managers MERCURY, VENUS, EARTH, and MARS to be a part of the cluster called PLANET, with the JUPITER queue manager acting as a gateway queue manager. The other queue managers will be standalone.
Three applications -- App1, App2, and App3 -- will connect to the cluster queue managers MERCURY, VENUS, and EARTH respectively. These applications put messages on a remote queue defined on their queue managers, which in turn point to the application queues hosted on the queue managers running outside the clusters. The following table and diagram summarize which applications are putting the messages and the final destination of the messages:
|Application Name||Local queue manager||Remote queue||Destination queue manager||Destination queue name|
The messages are routed to the destination queue managers through the gateway queue manager MARS. The concept of a queue manager alias is used to route the messages to the destination queue manager. Table 2 below shows the required queue manager alias on the application queue managers and the gateway queue manager MARS. It shows which application is pointing to which queue, and the final destination of the messages put by the applications:
|App name||Queue manager name||Application queue definition||Queue manager alias definition on MARS|
|APP1||MERCURY||Define QR(APP1.QR1) RNAME(APPA.QL1) rqmname (CLUSS00) cluster(PLANETS) REPLACE||DEFINE QR(CLUSS00) RQMNAME(JUPITER) RNAME(' ') XMITQ(JUPITER)|
|APP2||VENUS||VENUS Define QR(APP2.QR1) RNAME(APPB.QL1) rqmname (CLUSS01) cluster(PLANETS) REPLACE||DEFINE QR(CLUSS01) RQMNAME(SATURN) RNAME(' ') XMITQ(SATURN)|
|APP3||EARTH||Define QR(APP3.QR1) RNAME(APPC.QL1) rqmname (CLUSS02) cluster(PLANETS) REPLACE||DEFINE QR(CLUSS02) RQMNAME(URANUS) RNAME(' ') XMITQ(URANUS)|
Setting up the infrastructure
- Create the seven queue managers using the seven commands below. Also
create the required listeners:
CRTMQM MERCURY CRTMQM VENUS CRTMQM EARTH CRTMQM MARS CRTMQM JUPITER CRTMQM SATURN CRTMQM URANUS
- Add MERCURY and VENUS as full repositories for the cluster PLANETS,
and define the required cluster sender channels and cluster receiver
DEFINE CHANNEL (TO.MERCURY) CHLTYPE (CLUSSDR) CONNAME ('10.7.0.100(1414)') CLUSTER (PLANETS) REPLACE DEFINE CHANNEL (TO.MERCURY) CHLTYPE (CLUSRCVR) CONNAME ('10.7.0.100(1414)') CLUSTER (PLANETS) REPLACE DEFINE CHANNEL (TO.VENUS) CHLTYPE (CLUSRCVR) CONNAME ('10.7.0.100(1415)') CLUSTER (PLANETS) REPLACE DEFINE CHANNEL (TO.VENUS) CHLTYPE (CLUSSDR) CONNAME ('10.7.0.100(1415)') CLUSTER (PLANETS) REPLACE
- Make the queue managers EARTH and MARS part of the queue manager
cluster PLANETS by making the partial repositories:
DEFINE CHANNEL (TO.EARTH) CHLTYPE (CLUSSDR) CONNAME ('10.7.0.100(1414)') CLUSTER (PLANETS) REPLACE DEFINE CHANNEL (TO.EARTH) CHLTYPE (CLUSRCVR) CONNAME ('10.7.0.100(1416)') CLUSTER (PLANETS) REPLACE DEFINE CHANNEL (TO.MARS) CHLTYPE (CLUSRCVR) CONNAME ('10.7.0.100(1417)') CLUSTER (PLANETS) REPLACE DEFINE CHANNEL (TO.VENUS) CHLTYPE (CLUSSDR) CONNAME ('10.7.0.100(1415)') CLUSTER (PLANETS) REPLACE
- Define remote queues on MERCURY, VENUS, and EARTH with the rqmname as defined in the table above.
- Define local queues on JUPITER, SATURN, and URANUS as defined in Table 2 above.
- Define a queue manager alias on the cluster gateway queue manager:
DEFINE QR(CLUSS00) RQMNAME(JUPITER) RNAME(' ') XMITQ(JUPITER) DEFINE QR(CLUSS01) RQMNAME(SATURN) RNAME(' ') XMITQ(SATURN) DEFINE QR(CLUSS02) RQMNAME(URANUS) RNAME(' ') XMITQ(URANUS)
This article showed you how to use a queue manager alias for load balancing by implementing communications with queue managers both inside and outside a cluster. In this configuration, messages are distributed in "round-robin" fashion.
The authors would like to thank James A. Grant Jr., IBM Advisory IT Architect, WebSphere MQ, for his valuable input during the creation of this article.
- WebSphere MQ resources
- WebSphere MQ V7 information center
A single Web portal to all WebSphere MQ V7 documentation, with conceptual, task, and reference information on installing, configuring, and using WebSphere MQ V7.
- WebSphere MQ developer resources page
Technical resources to help you design, develop, and deploy messaging middleware with WebSphere MQ to integrate applications, Web services, and transactions on almost any platform.
MQ product page
Product descriptions, product news, training information, support information, trial download, and more.
- WebSphere MQ product family
A description of the ten or so different editions of WebSphere MQ.
- WebSphere MQ documentation library
WebSphere MQ information centers and product manuals.
Redbook: WebSphere MQ V7 features and
Describes the fundamental concepts and benefits of message queuing technology, describes the new features in V7, and provides a business scenario that shows those features in action.
- Download a free trial version of WebSphere MQ V7
A 90-day, full featured, no-charge trial of WebSphere MQ V7
- WebSphere MQ support page
A searchable database of support problems and their solutions, plus downloads, fixes, and problem tracking.
- WebSphere MQ forum
Get answers to your WebSphere MQ technical questions and share your knowledge with other users.
- WebSphere MQ SupportPacs
Downloadable code, documentation, and performance reports for the WebSphere MQ family of products. The majority of SupportPacs are available at no charge, while others can be purchased as fee-based services from IBM.
- WebSphere MQ V7 information center
- WebSphere resources
- developerWorks WebSphere developer
Technical information and resources for developers who use WebSphere products. developerWorks WebSphere provides product downloads, how-to information, support resources, and a free technical library of more than 2000 technical articles, tutorials, best practices, IBM Redbooks, and online product manuals. Whether you're a beginner, an expert, or somewhere in between, you'll find what you need to build enterprise-scale solutions using the open-standards-based WebSphere software platform.
- developerWorks WebSphere application integration developer
How-to articles, downloads, tutorials, education, product info, and other resources to help you build WebSphere application integration and business integration solutions.
- Most popular WebSphere trial downloads
No-charge trial downloads for key WebSphere products.
- WebSphere forums
Product-specific forums where you can get answers to your technical questions and share your expertise with other WebSphere users.
- WebSphere on-demand demos
Download and watch these self-running demos, and learn how WebSphere products and technologies can help your company respond to the rapidly changing and increasingly complex business environment.
- WebSphere-related articles on developerWorks
Over 3000 edited and categorized articles on WebSphere and related technologies by top practitioners and consultants inside and outside IBM. Search for what you need.
- developerWorks WebSphere weekly newsletter
The developerWorks newsletter gives you the latest articles and information only on those topics that interest you. In addition to WebSphere, you can select from Java, Linux, Open source, Rational, SOA, Web services, and other topics. Subscribe now and design your custom mailing.
- WebSphere-related books from IBM Press
Convenient online ordering through Barnes & Noble.
- WebSphere-related events
Conferences, trade shows, Webcasts, and other events around the world of interest to WebSphere developers.
- developerWorks WebSphere developer resources
- developerWorks resources
downloads for IBM software products
No-charge trial downloads for selected IBM® DB2®, Lotus®, Rational®, Tivoli®, and WebSphere® products.
business process management developer resources
BPM how-to articles, downloads, tutorials, education, product info, and other resources to help you model, assemble, deploy, and manage business processes.
Join a conversation with developerWorks users and authors, and IBM editors and developers.
- developerWorks tech briefings
Free technical sessions by IBM experts to accelerate your learning curve and help you succeed in your most challenging software projects. Sessions range from one-hour virtual briefings to half-day and full-day live sessions in cities worldwide.
- developerWorks podcasts
Listen to interesting and offbeat interviews and discussions with software innovators.
- developerWorks on
Check out recent Twitter messages and URLs.
- IBM Education Assistant
A collection of multimedia educational modules that will help you better understand IBM software products and use them more effectively to meet your business requirements.
- Trial downloads for IBM software products
Dig deeper into WebSphere on developerWorks
Get samples, articles, product docs, and community resources to help build, deploy, and manage your cloud apps.
Keep up with the best and latest technical info to help you tackle your development challenges.
Software development in the cloud. Register today to create a project.
Evaluate IBM software and solutions, and transform challenges into opportunities.