IBM WebSphere MQSeries allows different applications to communicate asynchronously through queues across different operating systems, different processors, and different application systems.
WebSphere MQSeries includes the Message Queue Interface (MQI), a common low-level programming application program interface (API). Applications use MQI to read and write messages to the queues.
A Queue Manager is a process that manages a set of objects. These objects include queues, channels, and process definitions.
A queue object stores messages that are sent by applications to the Queue Manager. The following are types of queues:
A local queue – is owned by the Queue Manager to which a program is connected.
A remote queue – is owned by a Queue Manager other than the Queue Manager to which a program is connected. A remote queue can be sent messages, but messages cannot be read from it.
An alias queue – is another name for a local or remote queue.
A dynamic local queue – is a queue that is created on the fly by an application. It is created from a model queue. The persistence of a dynamic queue is defined by the model queue from which it is created.
A model queue – is a queue that is used as a template for creating a dynamic local queue.
A cluster queue – is a queue that is owned by a cluster queue manager.
A channel – is a logical communication link. Channel types are client (client side of a connection), or server (server side of a connection).
A process definition defines a process that executes when incoming messages cause a trigger event.
A WebSphere MQSeries message consist of two parts:
Message header – message control information that contains a fixed-sized portion and a variable-sized portion.
Message body – application data that contains any type of data (text or binary).
When you use rfhCommand to publish a publication, if the message payload returned by msgrecv is set to:
MQRHRF – the RF header is included in the message body.
MQRHRH – the RF header is not included.
You can obtain the name value pairs in the RF header by querying @@msgproperties.
If the message body contains characters, code-set conversions are available either through MQSeries native services, or through user exit handlers. The format of the message body is defined by a field in the message header. MQ does not enumerate all possible message body formats, although some formats are provided in samples. Applications can enter any name of the format. For instance, “MQSTR” contains string data, “MQRHRF” contains topics for MQ pub/sub.
WebSphere MQSeries message types include the following
Datagram – no reply is expected.
Request – a reply is expected.
Reply – reply to a request message.
Report – contains status information from the Queue Manager or another application.
When messages are sent, various message header properties can be set, such as expiration, persistence, priority, correlation ID, and reply queue.
Message grouping enables you to organize a group of messages into a logically named group. Within a group, each logical message can further be divided into segments. A group is identified by a name, each logical message within a group is identified by a sequence number (starting with 1), and each segment of a logical message is identified by the offset of the message data with respect to the logical message. Segmented messages are not supported by MQ pub/sub, and an attempt to send a segmented message results in an error.
In a queue, messages appear in the physical order in which they were sent to the queue. This means that messages of different groups may be interspersed, and, within a group, the sequence numbers of the messages may be out of order (the latter can occur of two applications are sending messages with the same group ID and partitioned sequence numbers).
When messages are received, the read mode can be either:
Destructive – message is removed, or
Nondestructive – the message is retained. This is known as “browsing,” and allows applications to peruse one or more messages before deciding to remove a particular message from the queue.
Receivers can select particular messages by specifying message header properties such as correlation ID or message ID.
When messages are read—as either destructive or nondestructive—the order in which they are returned can be physical or logical. The order is defined by the queue definition. The queue can be defined as being in priority order or first-in, first-out order.
Copyright © 2005. Sybase Inc. All rights reserved. |
![]() |