Messages

A message is simply a collection of data sent by one application and intended for another application. WebSphere MQ Everyplace messages differ from those supported by WebSphere MQ messaging. In WebSphere MQ, messages are byte arrays, divided into a message header and a message body. WebSphere MQ creates the message header, which contains vital information, such as the identity of the reply-to queue, the reply-to queue manager, the message ID, and the correlation ID. The message body contains data that is useful only to the application.

Messages in WebSphere MQ Everyplace have no concept of a header or a message body. They are MQeFields, which consist of a name, a data type, and the data itself. Message names are ASCII character strings of unlimited length, excluding any of the characters:
{ } [ ] # ( ) : ; , ' " =
Table 1 describes the different data types:

Table 1. Data types

Type Description
ASCII String or a dynamic array of invariant ASCII strings, excluding any of the characters { } [ ] # ( ) : ; , ' " and =
Boolean True or false value
Byte Fixed array, or a dynamic array of byte values
Double floating point Value, fixed array, or a dynamic array of double floating point values
Fields Object or a dynamic array of fields objects (thus nesting of fields objects is supported)
Floating point Value, fixed array, or a dynamic array of floating point values
Integer 4 byte value, fixed array, or a dynamic array of integers
Long integer 8 byte value, fixed array, or a dynamic array of long integers
Short integer 2 byte value, fixed array, or a dynamic array of short integers
Unicode String or a dynamic array of Unicode strings

Additionally, messages include a UID (unique identifier) which is generated by WebSphere MQ Everyplace. This UID uniquely identifies each individual message object in the entire WebSphere MQ Everyplace network and is constructed from the:

Originating queue manager
This is the name of the originating queue manager, which must be unique. It is added by the queue manager on receipt of the message. As it is ASCII, every character is one byte long.

Creation time
This is the timestamp of a message. Therefore, in Java, this is the time that the message was created, and in C, this is the time that a fields item is added to a queue. The field item then becomes a message.

A message destined for another WebSphere MQ Everyplace queue manager does not require any additional information, though other properties are almost certainly present. Additional properties can:

Note:
In the C codebase a fields item only becomes a message upon arrival on a queue.

WebSphere MQ Everyplace adds property related information to a message (and subsequently removes it) in order to implement messaging and queuing operations. When sending a message between queue managers, you can add resend information to indicate that data is being retransmitted. Chapter 4, Messaging, of the WebSphere MQ Everyplace Application Programming Guide provides more information on message object properties.

Messages can also have attributes. Attributes are fundamental to the WebSphere MQ Everyplace security model and allow selective access to content and the protection of content. They have the following properties:

Table 2. Attribute object properties

Property Description
Authentication Controls access
Encryption Protects the contents when the object is dumped (and allows restoration)
Compression Reduces storage requirements (for transmission and storage)
Rule (Not applicable to C codebase) Controls permitted operations

For more information on the properties in Table 2, see Security.



© IBM Corporation 2002. All Rights Reserved