IBM Support

IT32295: MQ classes for Java application hangs when using the BINDINGS transport and getting messages with the MQGMO_CONVERT option

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.

 

APAR status

  • Closed as program error.

Error description

  • An MQ classes for Java application running on z/OS USS connects
    in binding mode to a queue manager on z/OS. The application
    contains the following code to get messages encoded in coded
    character set (CCSID) 523 from a queue, and convert them into
    UTF-8 (which maps to CCSID 1208):
    
    ....
    q = qmgr.accessQueue(qName, MQConstants.MQOO_FAIL_IF_QUIESCING |
    MQConstants.MQOO_BROWSE);
    final MQGetMessageOptions gmo = new MQGetMessageOptions();
    gmo.options = MQConstants.MQGMO_BROWSE_FIRST | MQConstants.
    MQGMO_CONVERT | MQConstants.MQGMO_NO_WAIT | MQConstants.
    MQGMO_FAIL_IF_QUIESCING;
    final MQMessage msg = new MQMessage();
    msg.characterSet = 1208;
    msg.format = CMQC.MQFMT_STRING;
    q.get(msg, gmo, bufferSize);
    .....
    
    When getting messages that are slightly smaller than the value
    of "bufferSize", the application hangs when issuing the line:
    
    q.get(msg, gmo, bufferSize);
    

Local fix

  • n/a
    

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    This issue affects users of the IBM MQ classes for Java who have
    applications that:
    
    - Connect to a queue manager using the BINDINGS transport.
    - And call the method MQDestination.get(MQMessage message,
    MQGetMessageOptions getMessageOptions, int maxMsgSize), passing
    in an MQGetMessageOptions object that specifies the option
    MQGMO_CONVERT and does not specify the option
    MQGMO_ACCEPT_TRUNCATED_MSG.
    
    
    Platforms affected:
    MultiPlatform
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    When using the MQ classes for Java, every MQMessage object used
    by an application has an internal buffer associated with it.
    This buffer is used to store the bytes representing the message
    payload. If an application calls the method:
    
    MQDestination.get(MQMessage message, MQGetMessageOptions
    getMessageOptions, int maxMsgSize)
    
    then the maximum size of the buffer will be equal to the value
    of the maxMsgSize parameter.
    
    If an MQ classes for Java application:
    
    - Connects to a queue manager using the BINDINGS transport.
    - And calls the MQDestination.get(MQMessage message,
    MQGetMessageOptions getMessageOptions, int maxMsgSize) method,
    passing in an MQGetMessageOptions object that specifies the
    option MQGMO_CONVERT and does not specify the option
    MQGMO_ACCEPT_TRUNCATED_MSG.
    
    the following sequence of events occurs:
    
    - The MQ classes for Java issue an MQGET API call to get the
    message, and store the bytes representing the message payload in
    the buffer.
    - Next, the MQ classes for Java pass the buffer into some
    internal queue manager routines that perform the data
    conversion.
    - The queue manager routines convert the message payload, and
    update the buffer with the new byte sequence.
    - Finally, the MQ classes for Java store the contents of the
    buffer in the MQMessage object.
    
    Now, when performing data conversion, it was possible for the
    number of bytes in the message to increase. If this happened,
    and the size of the converted message was larger than the
    maximum size of the buffer, the internal queue manager routines
    would fail to convert the message and pass:
    
    - Completion code 1 (MQCC_WARNING)
    - and either reason code 2120 (MQRC_CONVERTED_MSG_TOO_BIG) or
    2190 (MQRC_CONVERTED_STRING_TOO_BIG)
    
    back to the MQ classes for Java. The routines would not update
    the buffer, meaning it still contained the unconverted message.
    
    The MQ classes for Java would then get stuck in a loop,
    continually invoking the internal queue manager conversion
    routines passing in the same buffer, which was not large enough
    to hold the converted message.
    

Problem conclusion

  • To resolve this issue, the MQ classes for Java have been updated
    so that:
    
    - If an application calls the MQDestination.get(MQMessage
    message, MQGetMessageOptions getMessageOptions, int maxMsgSize)
    method, passing in an MQGetMessageOptions object that specifies
    the option MQGMO_CONVERT and does not specify the option
    MQGMO_ACCEPT_TRUNCATED_MSG.
    - And the internal queue manager conversion routines are unable
    to convert the message, as the number of bytes in the converted
    message is larger than the value of the maxMsgSize parameter
    
    then an MQException containing:
    
    - Completion code 1 (MQCC_WARNING)
    - And either reason code 2120 (MQRC_CONVERTED_MSG_TOO_BIG) or
    2190 (MQRC_CONVERTED_STRING_TOO_BIG)
    
    will be thrown back to the application - the MQ classes for Java
    will not attempt to invoke the internal queue manager conversion
    routines again, which prevents them from getting stuck in a
    loop. In addition to this, the MQMessage object passed into the
    method will be updated to contain the unconverted message data.
    
    This means that the application will be notified of the failure
    to convert the message data, and be able to access the
    unconverted message via the MQMessage object, which matches the
    behaviour documented in the 2120 (0848) (RC2120):
    MQRC_CONVERTED_MSG_TOO_BIG and 2190 (088E) (RC2190):
    MQRC_CONVERTED_STRING_TOO_BIG topics in the IBM MQ sections of
    IBM Knowledge Center. The URIs for these topics in the MQ V9.1.x
    section of IBM Knowledge Center are shown below:
    
    Topic: 2120 (0848) (RC2120): MQRC_CONVERTED_MSG_TOO_BIG
    URI:
    https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_latest/com
    .ibm.mq.tro.doc/q041810_.html
    
    Topic: 2190 (088E) (RC2190): MQRC_CONVERTED_STRING_TOO_BIG
    URI:
    https://www.ibm.com/support/knowledgecenter/SSFKSJ_latest/com.ib
    m.mq.tro.doc/q042320_.html
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
    Version    Maintenance Level
    v9.0 LTS   9.0.0.12
    v9.1 LTS   9.1.0.9
    v9.2 LTS   9.2.0.3
    v9.x CD    9.2.3
    
    The latest available maintenance can be obtained from
    'WebSphere MQ Recommended Fixes'
    http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg27006037
    
    If the maintenance level is not yet available information on
    its planned availability can be found in 'WebSphere MQ
    Planned Maintenance Release Dates'
    http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg27006309
    ---------------------------------------------------------------
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT32295

  • Reported component name

    IBM MQ BASE M/P

  • Reported component ID

    5724H7261

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2020-03-24

  • Closed date

    2021-04-22

  • Last modified date

    2021-04-22

  • APAR is sysrouted FROM one or more of the following:

    PH23534

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    IBM MQ BASE M/P

  • Fixed component ID

    5724H7261

Applicable component levels

[{"Line of Business":{"code":"LOB36","label":"IBM Automation"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.0"}]

Document Information

Modified date:
23 April 2021