Message Queues and Topics

EGL applications can send messages to and receive from EGL and non-EGL applications. Messages can be written to and read from queues. Alternatively, EGL applications can publish messages to topics. One or more EGL applications can subscribe to that topic to receive the message.

A message broker handles Message Queues and Topics.

Applications communicate with the broker to send and receive messages. EGL supports the following message brokers:

  • IBM® MQ (formerly WebSphere® MQ or MQSeries®)
  • RabbitMQ
  • Apache ActiveMQ®

The EGL runtime handles the underlying communication with the message broker. This allows EGL applications to communicate with EGL and non-EGL applications without having the knowledge of lower levels of the communication network and the location of the other applications.

For more information on Publish/Subscribe, refer to the Publish/subscribe messaging.

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 message queues and topics in two ways:

  • You can use EGL-specific keywords like add and get next. In this case, EGL handles all the details of communicating with the message broker.
  • When using IBM MQ, you can directly write IBM MQ API calls to support older programs.

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

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

Subsequent sections provide the details of creating 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 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), the associated resource association filename(topicName), and other basic information.

For more information about these properties, see MQRecord properties.