WebSphere® MQ message queues

Message queueing provides an alternative to calling a remote program. With message queueing, programs communicate by writing to and reading messages from queues.

The Message Queue Interface (MQI) is an IBM® specification of an application programming interface (API) for accessing the WebSphere® MQ (formerly MQSeries®) message and queuing services that support data transfer between programs running on a wide variety of IBM® and non-IBM platforms. The services allow programs to communicate without knowledge of the lower levels of the communication network and without knowledge of the location of the other programs.

A message queue can be on the same system as a program (local) or on another system (remote). Queue managers manage access to queues and transmission of data between queues.

An MQI message is a string of data sent from one program to another. An MQI message consists of program information and routing information used by the message queue manager (control information). The structure and content of the program information is determined by the communicating programs, not by the queue manager.

Programs that use message queueing techniques have the following features:
  • There is no physical connection between programs.
  • Communication network access functions are built into the queue managers, not into the programs.
  • Communicating programs can run in parallel.
  • Communicating programs do not need to be running concurrently.
  • Intermittent communication link failures do not prevent messages from being delivered.
  • Work is carried out by small, self-contained programs.
  • Communication can be driven by events.
  • Messages can be assigned priorities.
  • Messages can be recoverable resources, committed or rolled back along with database or file updates.
  • Workloads can be balanced by starting multiple servers for processing a single queue.
  • Availability can be increased by assigning multiple alternative processors to service a queue.
EGL supports calls to WebSphere® MQ message queues in two ways:
  • You can use EGL-specific keywords like add and get next. In this case EGL handles all the details of generating WebSphere® MQ API calls.
  • You can write WebSphere® MQ API calls directly, to support older programs.

New code should use EGL keywords to communicate with message queues.

EGL uses resource associations to determine the queue to which the record is assigned. For more information, see Defining resource associations for message queues.

Subsequent sections provide the details of creating WebSphere® MQ programs in EGL.

Defining messages in EGL

EGL uses a record with the MQRecord stereotype to create the internal representation of a message.

MQRecords follow the same general rules as other EGL records. They consists of message data and a number of properties. One set of properties tells EGL how to create the API commands it generates to communicate with WebSphere® MQ. Another set provides the physical name of the message queue to use (fileName), the logical queue name (queueName), the size of the variable length record (lengthItem), and other basic information.

For more information about these properties, see MQRecord properties.