
BM WebSphere MQ (WMQ) is message-oriented middleware (MOM) that facilitates application-to-application communication using messages and queues. WMQ supports point-to-point and publish/subscribe messaging and can be installed on most platforms, including Windows, AIX, HP-UX, and Sun Solaris, which make it suitable for today's heterogeneous computing environments.
For Java developers, WMQ provides two interfaces for Java applications:
- MQ base classes for Java: A Java interface based on the WMQ native interface.
- MQ JMS: An implementation of the Java Messaging Service (JMS) 1.1 interface.
JMS extends Java's interoperability by enabling Java applications to connect to, as well as send and receive messages from, any messaging provider that complies with the JMS specification. JMS applications can exchange messages using either point-to-point or publish/subscribe messaging.
This article describes the process of developing with WMQ and JMS, focusing on point-to-point messaging. By walking through the following steps, it teaches how to use a Java class written with the JMS interfaces:
- Create WMQ objects.
- Create JMS administered objects.
- Explain the JMS code.
- Run a sample class to send messages to and receive messages from WMQ.
WMQ Installation
This tutorial uses MQ Version 7 on Windows XP. (
Download a trial from the IBM web site.) The installation on Windows is straightforward; keep all the default values as you go through the installation wizard.
Don't worry if you haven't used WMQ before. You will use the Eclipse-based WebSphere MQ Exploreran easy GUI for administering WMQto perform basic definitions.