public class MQMD
extends com.ibm.mq.jmqi.JmqiObject
Character data in the message descriptor is in the character set of the queue manager to which the application is connected; this is given by the CodedCharSetId queue manager attribute. Numeric data in the message descriptor is in the native machine encoding (given by MQENC_NATIVE).
If the sending and receiving queue managers use different character sets or encodings, the data in the message descriptor is converted automatically - it is not necessary for the receiving application to perform these conversions.
You can write an exit to convert an application's message data, that will be invoked when an MQGET call retrieves the message.
MQMessage| Modifier and Type | Field and Description |
|---|---|
byte[] |
accountingToken
The accounting token.
|
java.lang.String |
applicationIdData
Application ID data.
|
java.lang.String |
applicationOriginData
Data about the originating application.
|
int |
backoutCount
The number of times the message has been backed out.
|
int |
characterSet
The coded character set identifier of character data in the application message data.
|
byte[] |
correlationId
Specifies the correlation identifier of the message to be retrieved.
|
int |
encoding
Specifies the representation used for numeric values in the application message data.
|
int |
expiry
The expiry time (in tenths of a second).
|
int |
feedback
The nature of the feedback report.
|
java.lang.String |
format
A name which indicates the nature of the data in the message.
|
byte[] |
groupId
The ID of the message group.
|
int |
messageFlags
Flags controlling the segmentation and status of the message.
|
byte[] |
messageId
Specifies the message identifier of the message to be retrieved.
|
int |
messageSequenceNumber
Sequence number of logical message within group.
|
int |
messageType
Indicates the type of the message.
|
int |
offset
Offset of data in the physical message from the start of the logical message.
|
int |
originalLength
Original length of a segmented message.
|
int |
persistence
The message persistence.
|
int |
priority
The message priority.
|
java.lang.String |
putApplicationName
The name of the application that put the message.
|
int |
putApplicationType
The type of application that put the message.
|
java.util.GregorianCalendar |
putDateTime
The time and date when the message was put.
|
java.lang.String |
replyToQueueManagerName
The name of the queue manager to which reply or report messages should be sent.
|
java.lang.String |
replyToQueueName
The name of the queue to which a reply should be sent.
|
int |
report
This field enables the application sending the original message to specify which report
messages are required, whether the application message data is to be included in them, and also
how the message and correlation ID in the report or reply are to be set.
|
java.nio.charset.CodingErrorAction |
unmappableAction
The action to be taken if character data cannot be encoded using the character set specified
The default value for this field is java.nio.charset.CodingErrorAction.REPORT, but the other
java.nio.charset.CodingErrorAction constants are valid values.
|
byte[] |
unMappableReplacement
The byte sequence to be used if character data cannot be encoded using the character set specified and the
unmappableAction is java.nio.charset.CodingErrorAction.REPLACE.
|
java.lang.String |
userId
The user ID.
|
| Constructor and Description |
|---|
MQMD()
The default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getVersion()
Gets the version of the message.
|
void |
setVersion(int version)
Sets the version of the message.
|
public int report
| basic | with data | with full data | |
|---|---|---|---|
| Exception | CMQC.MQRO_EXCEPTION
| CMQC.MQRO_EXCEPTION_WITH_DATA
| CMQC.MQRO_EXCEPTION_WITH_FULL_DATA
|
| Expiration | CMQC.MQRO_EXPIRATION
| CMQC.MQRO_EXPIRATION_WITH_DATA
| CMQC.MQRO_EXPIRATION_WITH_FULL_DATA
|
| Confirm on arrival | CMQC.MQRO_COA
| CMQC.MQRO_COA_WITH_DATA
| CMQC.MQRO_COA_WITH_FULL_DATA
|
| Confirm on delivery | CMQC.MQRO_COD
| CMQC.MQRO_COD_WITH_DATA
| CMQC.MQRO_COD_WITH_FULL_DATA
|
You can specify how the message ID is generated for the report or reply message:
You can specify one of the following to control how to set the correlation ID of the report or reply message:
You can specify the following to pass the discard option and exiry time of the original message to the report or reply message:
You can specify one of the following to control the disposition of the original message when it cannot be deleivered to the destination queue:
If no report options are specified, the default is
CMQC.MQRO_NEW_MSG_ID | CMQC.MQRO_COPY_MSG_ID_TO_CORREL_ID | CMQC.MQRO_DEAD_LETTER_Q.
public int messageType
Application defined values can also be used; these should be in the range
MQMT_APPL_FIRSTto MQMT_APPL_LAST.
The default value of this field is CMQC.MQMT_DATAGRAM.
public int expiry
CMQC.MQRO_EXPIRATIONflags, then
a report is generated when the message is discarded.
The default value is CMQC.MQEI_UNLIMITED, which means that the
message never expires.
public int feedback
CMQC.MQMT_REPORTto indicate the nature of the report.
The following feedback codes are defined:
CMQC.MQFB_EXPIRATION
CMQC.MQFB_COA
CMQC.MQFB_COD
CMQC.MQFB_QUIT
MQFB_NONE
CMQC.MQFB_SYSTEM_FIRST
CMQC.MQFB_APPL_CANNOT_BE_STARTED
CMQC.MQFB_TM_ERROR
CMQC.MQFB_APPL_TYPE_ERROR
CMQC.MQFB_STOPPED_BY_MSG_EXIT
CMQC.MQFB_XMIT_Q_MSG_ERROR
CMQC.MQFB_SYSTEM_LAST
CMQC.MQFB_ACTIVITY
CMQC.MQFB_MAX_ACTIVITIES
CMQC.MQFB_NOT_FORWARDED
CMQC.MQFB_NOT_DELIVERED
CMQC.MQFB_UNSUPPORTED_FORWARDING
CMQC.MQFB_UNSUPPORTED_DELIVERY
Application-defined feedback values in the range CMQC.MQFB_APPL_FIRSTto CMQC.MQFB_APPL_LASTcan also be used.
The default value of this field is CMQC.MQFB_NONE, indicating that no
feedback is provided.
public int encoding
The following encodings are defined:
| binary | packed decimal | floating point | |
|---|---|---|---|
| big-endian | CMQC.MQENC_INTEGER_NORMAL |
CMQC.MQENC_DECIMAL_NORMAL |
CMQC.MQENC_FLOAT_IEEE_NORMAL |
| little-endian | CMQC.MQENC_INTEGER_REVERSED |
CMQC.MQENC_DECIMAL_REVERSED |
CMQC.MQENC_FLOAT_IEEE_REVERSED |
CMQC.MQENC_INTEGER_NORMAL |
MQENC_DECIMAL_NORMAL |
CMQC.MQENC_FLOAT_S390 |
Construct a value for the encoding field by combining one value from each row of the table by
use of '+' or '|' operators. The default value is CMQC.MQENC_INTEGER_NORMAL |
CMQC.MQENC_DECIMAL_NORMAL | CMQC.MQENC_FLOAT_IEEE_NORMAL. For convenience this value is also
represented by CMQC.MQENC_NATIVE. This setting causes
MQMessage.writeInt()to write, for example, a big-endian integer,
and MQMessage.readInt()to read a big-endian integer.
A loss in precision can occur when converting from IEEE format floating point values to
public int characterSet
MQMessage.readString(),
MQMessage.readLine()and MQMessage.writeString().
The default value for this field is CMQC.MQCCSI_Q_MGR. The following
additional character set values are supported:
public java.nio.charset.CodingErrorAction unmappableAction
The default value for this field is java.nio.charset.CodingErrorAction.REPORT, but the other java.nio.charset.CodingErrorAction constants are valid values.
public byte[] unMappableReplacement
public java.lang.String format
The queue manager built-in formats are:
CMQC.MQFMT_NONE
CMQC.MQFMT_ADMIN
CMQC.MQFMT_COMMAND_1
CMQC.MQFMT_COMMAND_2
CMQC.MQFMT_DEAD_LETTER_HEADER
CMQC.MQFMT_EVENT
CMQC.MQFMT_MD_EXTENSION
CMQC.MQFMT_PCF
CMQC.MQFMT_STRING
CMQC.MQFMT_TRIGGER
CMQC.MQFMT_XMIT_Q_HEADER
The default value is CMQC.MQFMT_NONE.
public int priority
The default value is CMQC.MQPRI_PRIORITY_AS_Q_DEF.
public int persistence
The default value is CMQC.MQPER_PERSISTENCE_AS_Q_DEF
public byte[] messageId
MQQueue.get(). Normally the queue manager returns the first
message whose message identifier and correlation identifier match those specified. The special
value CMQC.MQMI_NONE allows any message identifier to match.
For MQQueue.put()this specifies the message identifier to use.
If CMQC.MQMI_NONE is specified, the queue manager generates a unique message identifier when the
message is put. The value of this field is updated after the put to indicate the message
identifier that was used.
The default value is CMQC.MQMI_NONE.
public byte[] correlationId
MQQueue.get(). Normally the queue manager returns the first
message whose message identifier and correlation identifier match those specified. The special
value CMQC.MQCI_NONE allows any correlation identifier to match.
For MQQueue.put()this specifies the correlation identifier to
use.
The default value is CMQC.MQCI_NONE.
public int backoutCount
MQQueue.get(), as part of a unit of work,
and subsequently backed out.
The default value is zero.
public java.lang.String replyToQueueName
The default value is "" (empty string).
public java.lang.String replyToQueueManagerName
The default value is "" (empty string).
public java.lang.String userId
The default value is "" (empty string).
public byte[] accountingToken
The default value is an array of zeros.
public java.lang.String applicationIdData
The default value is "" (empty string).
public int putApplicationType
The following values are defined by the system:
The default value is the special value CMQC.MQAT_NO_CONTEXT, which indicates that no context information is present in the message.
public java.lang.String putApplicationName
The default value is "" (empty string).
public java.util.GregorianCalendar putDateTime
public java.lang.String applicationOriginData
The default value is "" (empty string).
public byte[] groupId
public int messageSequenceNumber
public int offset
public int messageFlags
public int originalLength
public int getVersion()
public void setVersion(int version)
throws MQException
version - the value to be set - valid values are
MQException - if the value of the version is invalid.