WebSphere MQ messages
WebSphere MQ messages
•
WebSphere MQ messages are made up of two
parts:
•
1. Message descriptor
•
2. Application data
Message descriptor
•
You can access message control information
using the MQMD structure.
Types of message
•
There are four types of message defined by
WebSphere MQ:
•
Datagram
•
Request
•
Reply
•
Report
Datagrams
•
Use a datagram when you do not require a
reply from the application that receives the message (that is, gets the message
from the queue).
•
An example of an application that could use
datagrams is one that displays flight information in an airport lounge. A
message could contain the data for a whole screen of flight information.
Request messages
•
Use a request message when you want a
reply from the application that receives the message.
Reply messages
•
Use a reply message when you reply to
another message.
•
When
you create a reply message, respect any options that were set in the message
descriptor of the message to which you are replying.
Report messages
•
Report messages inform applications
about events such as the occurrence of an error when processing a message. They
can be generated by:
•
A
queue manager,
•
A
message channel agent (for example, if they cannot deliver the message), or
•
An application (for example, if it cannot use
the data in the message).
Types of Report messages
•
Exception report message.
•
This is sent in response to a message with the
exceptions flag set
•
Expiry report message.
•
This indicates that an application attempted
to retrieve a message that had reached its expiry threshold.
•
confirmation of arrival (COA) report
message
•
This indicates that the message has reached
its target queue
•
Confirmation of delivery (COD) report
message.
•
This indicates that the message has been
retrieved by a receiving application
•
Negative action notification (NAN)
report message. This indicates that a request has not been successfully
serviced

Message Queuing Concepts
•This
technology builds on two basic concepts: messages and queues:
Queues:
•A
Queue is a container of messages. New messages are placed at the end of the
queue, and messages
•are
usually retrieved from the front of the queue.
Queuing is the mechanism by which messages are held until an application is ready to process them.
Queuing allows you to:
1. Communicate between programs
2. Select the order in which a program processes messages.
3. Balance loads on a system
4. Increase the availability of your applications
Provides
a buffer between the producer and consumer
•Asynchronous
•Producer and consumer communicates in Asynchronous mode . i.e.
No wait state.
•Synchronous
•Producer must wait for the consumer to become available and
complete the processing of the message before being able to continue
•Batch processing
•A server might not want to process and consume each message as it arrives on a
particular queue and process them in one batch.
Message:
•A
node in a system often needs to communicate information to, or request a
service from, another node in that system or an interconnected system. This
•piece
of information or request can be considered a message
•In
message queuing, a message
is a collection of data sent by one program and intended for another program.•
•WebSphere MQ defines four types of message:
• Datagram A
simple message for which no reply is expected
• Request A
message for which a reply is expected
• Reply A
reply to a request message
• Report A
message that describes an event such as the
• occurrence of an error
•A WebSphere MQ
message consists of control information and application data.
•The
control information is defined in a message descriptor structure (MQMD) and contains such things
as:
•The type of the message
• An identifier for the message
• The priority for delivery of the message
Types of Messaging:
-- Point-to-point
-- Publish/Subscribe
Point-to-point Messaging
Types of Messaging:
-- Point-to-point
-- Publish/Subscribe
Point-to-point Messaging
•Many
messages are intended to be consumed exactly once. The point within the system
that consumes the message might or might not be known to the producer of the
message.
•The
producer provides enough information for the messaging infrastructure to
deliver the message to a single consumer.
•In
point-to-point messaging a message arrives once, and once only, at a single and
correct destination.
Categories of PTP Messaging
•Send
and forget messaging:
•A
message is sent to a service that performs an action based on that message.
•Request/reply
messaging:
•A
message is sent to a service that performs an action based on that message and
then returns a reply to the originator of the message.
Publish/Subscribe Messaging
•Publish/subscribe
messaging provides the concept of a topic on which any
•number
of interested consumers of information can subscribe in order to register
•their
interest. This is similar to the way that a person might subscribe only to
•magazines
about topics in which they are interested. Each topic provides
•particular
event or state information.

What Is Message Queuing ?
Message Queuing
•Message
Queuing (aka MQ) is a way for applications running on
various platforms, at various times and various servers, to communicate with
each other across heterogeneous networks that may be temporarily off-line. It
provides a form of communication between applications without the hassle of
dealing with low-level communication interfaces/protocols.
•In a
queuing environment, messages between therefor only the queuing system must be available.
After the message is put in the queuing system, it is made available by the
queuing system to the receiving
application .
•Messages are stored in queues until an application is ready to
read and process them; this is an asynchronous communications method. A
synchronous method is also possible, using the Request-Reply mechanism
This is one of important technology of Application servers and enterprise applications.
Main features of Message queuing:
Main features of Message queuing:
•1.
There are no direct connections between programs.
•2.
Communication between programs can be time-independent.
•3.
Work can be carried out by small, self-contained programs.
•4.
Communication can be driven by events.
•5.
Applications can assign a priority to a message
•6.
Security.
7. Data integrity.
7. Data integrity.
•8.
Recovery support.
