Wednesday, April 27, 2011

MQ Series : Overview in brief

MQSeries implements a store-and-forward protocol to ensure the safe
delivery of messages between applications.
As with electronic mail, the individual messages that may be part of a
transaction, travel through a network on a store-and-forward basis. If a
link between nodes fails, the message is kept until the link is restored, or
the operator or program redirects the message.
An MQSeries message consists of control information and application data.


Message descriptor :
The control information is defined in a message descriptor structure (MQMD).
MQMD contains such things as:
The type of the message
An identifier for the message
The priority for delivery of the message
If you are asking a question, you may include in the message descriptor, the
name of the queue on which you want to receive the reply.


Queue manager
A queue manager is a system program that provides queuing services to
applications.To an application, each
queue manager is identified by a connection handle (Hconn).

Correlation identifier
To help the requester to associate the message replies with its original request,an application can set a correlation identifier field in the descriptor of each message.Programs should copy the message identifier of the request message into the correlation identifier field of their reply messages.

Request-Reply message Linking
If you want to link your reply message with your request message, there are two options:
You can give your application the responsibility of ensuring that it puts
information into the reply message that relates to the request message.
You can use the report field in the message descriptor of your request
message to specify the content of the MsgId and CorrelId fields of the
reply message.
You can request that either the MsgId or the CorrelId of the original message
is to be copied into the CorrelId field of the reply message (the default
action is to copy MsgId).
You can request that either a new MsgId is generated for the reply message,
or that the MsgId of the original message is to be copied into the MsgId
field of the reply message (the default action is to generate a new message
identifier).

Types of message
There are four types of message defined by MQSeries:
Datagram
Request
Reply
Report
Each type of message is identified by an MQMT_* value.


MsgDeliverySequence and Message Priority
The MsgDeliverySequence attribute of the queue determines whether messages on
the queue are stored in FIFO (first in, first out) sequence, or in FIFO within priority sequence. If this attribute is set to MQMDS_PRIORITY, messages are enqueued with the priority specified in the Priority field of their message descriptors; but if it is set to MQMDS_FIFO, messages are enqueued with the default priority of the queue.

Group identifier
The group identifier is usually generated by the queue manager when the first
message of a group is put onto a queue. The MsgSeqNumber field identifies the position of the message within the group and the Offset field identifies the segments within the message.

Cluster
A cluster is a network of queue managers that are logically associated in some way.
In a traditional MQSeries network using distributed queuing, every queue
manager is independent. If one queue manager needs to send messages to another
it must have defined
a transmission queue,
a channel to the remote queue manager, and
a remote queue definition for every queue to which it wants to send messages.

Client
An MQSeries client is an independently installable component of an MQSeries
product. It allows you to run MQSeries applications, by means of a
communications protocol, to interact with one or more Message Queue Interface
(MQI) servers on other platforms and to connect to their queue managers.

Shared queues
MQSeries allows local queues to be shared by a group of queue
managers, giving improved throughput and availability. Such queues are called
shared queues, and the queue managers form a queue-sharing group, which can
process messages on the same shared queues.

Syncpointing
You can use the syncpointing facilities provided by MQSeries or your operating system to ensure that your data remains consistent with other resources.

Persistence
You can use the persistence feature of MQSeries messages to
assure the delivery of important messages.
The queue manager preserves all persistent messages, recovering them
when necessary from the MQSeries log files, when it is restarted.
Note that messages on shared queues cannot be made persistent.

Synchronous request and reply messages
This implies that you set a timeout period for the reply to answer your request, and if you do not receive the reply within that period, it is treated as an error.

Messages Waiting
A program that is serving a queue can await messages by:
Polling: Making periodic calls on the queue to see whether a message has
arrived.
Waiting until either a message arrives, or a specified time interval expires
Setting a signal so that the program is informed when a message arrives.

Context information
Context information is used for associating messages with the user who generated them, and for identifying the application that generated the message. Such information is useful for security, accounting, auditing, and problem determination.

Message triggering
MQSeries triggering enables a program to be started automatically when messages arrive on a queue.
You can set trigger conditions on a queue so that a program is
started to process that queue:
Every time a message arrives on the queue
When the first message arrives on the queue
When the number of messages on the queue reaches a predefined number

MaxMsgLength
In MQSeries, the MaxMsgLength attribute of the queue manager is fixed
at 100 MB and the MaxMsgLength attribute of the queue defaults to 4 MB
(4 194 304 bytes) which you can amend up to 100 MB if required. However, the limit is 63 KB when using shared queues accessed by queue managers in a queue-sharing group.

No comments:

Post a Comment