com.ibm.mq

Class MQMD

  • java.lang.Object
    • com.ibm.mq.jmqi.JmqiObject
      • com.ibm.mq.MQMD
  • Direct Known Subclasses:
    MQMessage


    public class MQMD
    extends com.ibm.mq.jmqi.JmqiObject
    The MQMD class contains the control information that accompanies the application data when a message travels between the sending and receiving applications.

    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.

    See Also:
    MQMessage
    • Field Summary

      Fields 
      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 taken from system Java MQI, which can be configured via the Java system property: com.ibm.mq.cfg.jmqi.UnmappableCharacterAction The default Java MQI system value is used when the above Java system property has not been configured on the Java Runtime Environment and is java.nio.charset.CodingErrorAction.REPORT.
      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.
      • Fields inherited from class com.ibm.mq.jmqi.JmqiObject

        COMP_JM, COMP_JN, COMP_JO
    • Constructor Summary

      Constructors 
      Constructor and Description
      MQMD()
      The default constructor.
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      int getVersion()
      Gets the version of the message.
      void setVersion(int version)
      Sets the version of the message.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • expiry

        public int expiry
        The expiry time (in tenths of a second). It is set by the application which puts the message. After a message's expiry time has elapsed, it is eligible to be discarded by the queue manager. If the message specified one of the 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.

      • characterSet

        public int characterSet
        The coded character set identifier of character data in the application message data. It alters the behaviour of 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:

        850
        commonly used ASCII codeset
        819
        the ISO standard ASCII codeset
        37
        the American EBCDIC codeset
        1200
        Unicode
        1208
        UTF-8
      • unmappableAction

        public 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 taken from system Java MQI, which can be configured via the Java system property: com.ibm.mq.cfg.jmqi.UnmappableCharacterAction The default Java MQI system value is used when the above Java system property has not been configured on the Java Runtime Environment and is java.nio.charset.CodingErrorAction.REPORT. Other java.nio.charset.CodingErrorAction constants are valid values.

      • unMappableReplacement

        public 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.
        The default value for this field is taken from system Java MQI, which can be configured via the Java system property: com.ibm.mq.cfg.jmqi.UnmappableCharacterReplacement The default Java MQI system value is used when the above Java system property has not been configured on the Java Runtime Environment and is the UTF-8 representation of '?'.
        The default Java replacement String will be used in decoding operations.
      • messageId

        public byte[] messageId
        Specifies the message identifier of the message to be retrieved. This applies to 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.

      • correlationId

        public byte[] correlationId
        Specifies the correlation identifier of the message to be retrieved. This applies to 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.

      • backoutCount

        public int backoutCount
        The number of times the message has been backed out. This is the number of times the message has been returned by MQQueue.get(), as part of a unit of work, and subsequently backed out.

        The default value is zero.

      • replyToQueueName

        public java.lang.String replyToQueueName
        The name of the queue to which a reply should be sent. The application that issued the get request for the message should send CMQC.MQFMT_REPLY and CMQC.MQFMT_REPORT messages to this queue.

        The default value is "" (empty string).

      • replyToQueueManagerName

        public java.lang.String replyToQueueManagerName
        The name of the queue manager to which reply or report messages should be sent.

        The default value is "" (empty string).

      • userId

        public java.lang.String userId
        The user ID. It is part of the identity of the message and identifies which user originated it.

        The default value is "" (empty string).

      • accountingToken

        public byte[] accountingToken
        The accounting token. This is part of the identity of the message and it allows work done as a result of the message to be appropriately charged.

        The default value is an array of zeros.

      • applicationIdData

        public java.lang.String applicationIdData
        Application ID data. This is part of the identity context of the message - information defined by the application suite; it can be used to provide additional information about the message or its originator.

        The default value is "" (empty string).

      • putApplicationType

        public int putApplicationType
        The type of application that put the message. The value can be defined by the system or by the user.

        The following values are defined by the system:

        • MQC.MQAT_AIX
        • MQC.MQAT_CICS
        • MQC.MQAT_DOS
        • MQC.MQAT_IMS
        • MQC.MQAT_MVS
        • MQC.MQAT_OS2
        • MQC.MQAT_OS400
        • MQC.MQAT_QMGR
        • MQC.MQAT_UNIX
        • MQC.MQAT_WINDOWS
        • MQC.MQAT_JAVA
        • MQC.MQAT_UNKNOWN
        • MQC.MQAT_NO_CONTEXT
        • MQC.MQAT_CICS_VSE
        • MQC.MQAT_VMS
        • MQC.MQAT_GUARDIAN
        • MQC.MQAT_VOS
        • MQC.MQAT_DEFAULT
        • MQC.MQAT_NSK
        • MQC.MQAT_CICS_BRIDGE
        • MQC.MQAT_NOTES_AGENT
        • MQC.MQAT_WINDOWS_NT
        • MQC.MQAT_IMS_BRIDGE
        • MQC.MQAT_XCF

        The default value is the special value CMQC.MQAT_NO_CONTEXT, which indicates that no context information is present in the message.

      • putApplicationName

        public java.lang.String putApplicationName
        The name of the application that put the message.

        The default value is "" (empty string).

      • putDateTime

        public java.util.GregorianCalendar putDateTime
        The time and date when the message was put.
      • applicationOriginData

        public java.lang.String applicationOriginData
        Data about the originating application. This can be used by the application to provide additional information about the origin of the message.

        The default value is "" (empty string).

      • groupId

        public byte[] groupId
        The ID of the message group. This identifies the message group to which the message belongs.
      • messageSequenceNumber

        public int messageSequenceNumber
        Sequence number of logical message within group.
      • offset

        public int offset
        Offset of data in the physical message from the start of the logical message.
      • originalLength

        public int originalLength
        Original length of a segmented message.
    • Constructor Detail

      • MQMD

        public MQMD()
        The default constructor.
    • Method Detail

      • getVersion

        public int getVersion()
        Gets the version of the message.
        Returns:
        the version.
      • setVersion

        public void setVersion(int version)
                        throws MQException
        Sets the version of the message.
        Parameters:
        version - the value to be set - valid values are
        • com.ibm.mq.constants.CMQC.MQMD_VERSION_1
        • com.ibm.mq.constants.CMQC.MQMD_VERSION_2
        Throws:
        MQException - if the value of the version is invalid.
(c) Copyright IBM Corp. 2008, 2015. All Rights Reserved.