IBM Support

IT17680: JMS application running in migration mode takes a long time to stop a JMS connection

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

  • A MQ-JMS application is using the MQ classes for JMS v8.0.
    
    It has created a single JMS Connection, and has used this
    Connection to create a number of JMS Sessions, from which it has
    created several MessageListeners.  The JMS Connection is
    connected to a v6.0 queue manager.
    
    The asynchronous MessageListeners have been consuming messages,
    before all the queues were emptied.  The MessageListeners are
    still active, but not processing due to having no messages on
    their source queues to consume.  The application then issues a
    stop command on the Connection:
    
      javax.jms.Connection.stop()
    
    and it is observed that it takes a long time to complete, in the
    order of several minutes.  This was not the case when using the
    WebSphere MQ classes of for JMS v6.0.2.9, where this method call
    completed almost immediately.
    

Local fix

  • Reducing the polling interval will decrease the time it takes
    for  the Connection.stop() method call to complete.
    
    This is a property of the MQConnectionFactory, and can be
    modified by updating the property:
    
      POLLINGINT
    
    from its default value of 5000ms (5 seconds).
    
    Alternatively it can be  programmatically altered by calling the
    method:
    
    com.ibm.mq.jms.MQConnectionFactory.setPollingInterval(int
    interval)
    
    Note that decreasing this value increases the number of MQGET
    calls which the asychronous MessageListeners make to consume
    messages from the queue, in periods where there is insufficient
    messages on the queue to keep the MessageListener from running
    at its maximum speed.
    

Problem summary

  • ****************************************************************
    USERS AFFECTED:
    Users of the MQ classes for JMS, who are:
    
      (1) Running in migration mode meaning one or more of:
        (a) Connecting to a v6 or earlier queue manager
        (b) Using a channel with the SHARECNV attribute to be the
    value '0'
        (c) Setting the ProviderVersion property of the
    ConnectionFactory
    
      (2) Using a JMS Connection which has had multiple JMS
    MessageListeners created under it, and there are insufficient
    messages on the queue to keep the MessageListener constantly
    active.
    
      (3) Invoking "Connection.stop()"
    
    
    Platforms affected:
    MultiPlatform
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    As of APAR IZ70015 which went into WebSphere MQ 6.0.2.10, the
    method call:
    
      javax.jms.Connection.stop()
    
    will not return to the application until the asynchronous
    message consumption associated with the MessageListeners has
    completed, in accordance with the JMS specification.
    
    
    When the v7.0 and beyond MQ classes for JMS is running in
    migration mode, the underlying mechanism employed to consume
    messages asynchronously is to perform a series of polling MQGET
    requests, using a wait time the value defined in the
    "pollingInterval" on the ConnectionFactory used to create the
    JMS Connection, which defaults to 5000ms (5 seconds).
    
    There is no mechanism to interrupt this MQGET in migration mode,
    so when the Connection.stop() method call is made, it will not
    return until this 5 second MQGET has completed.
    
    If multiple MessageListeners have been created from a single JMS
    Connection, the Connection.stop() method call will wait for each
    one to complete sequentially.  For example, if there are 10
    MessageListeners running from the JMS Connection, and the
    average time to wait is 2.5 seconds (half the default
    pollingTime interval), it might be expected to wait an average
    of (10 x 2.5) 25 seconds.  This wait time increases linearly
    with the number of MessageListeners which are running from this
    JMS Connection.
    

Problem conclusion

  • The MQ classes for JMS has been optimised such that when it is
    running in migration mode, when the application makes the method
    call:
    
      javax.jms.Connection.stop()
    
    all of the MessageListeners complete a single cycle of their
    polling MQGET, and then stop.  This means that the average wait
    time might now be expected to be in the region of 2.5 seconds,
    regardless of the number of MessageListeners running against the
    JMS Connection.
    
    
    Note that if the application calls:
    
      javax.jms.Connection.close()
    
    without first calling Connection.stop(), such that the
    MessageListeners are still active, a long wait will likely be
    encountered again.  The optimisation associated with this APAR
    has ONLY been applied to the Connection.stop() API call.  If
    performance in closing is an issue for you in this scenario, it
    is suggested that you first call:
    
      javax.jms.Connection.stop();
    
    followed by:
    
      javax.jms.Connection.close();
    
    which will then complete quickly.
    
    ---------------------------------------------------------------
    The fix is targeted for delivery in the following PTFs:
    
    Version    Maintenance Level
    v8.0       8.0.0.7
    v9.0 CD    9.0.2
    v9.0 LTS   9.0.0.1
    
    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

    IT17680

  • Reported component name

    WMQ BASE MULTIP

  • Reported component ID

    5724H7251

  • Reported release

    800

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2016-10-26

  • Closed date

    2016-12-16

  • Last modified date

    2017-06-01

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

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

Fix information

  • Fixed component name

    WMQ BASE MULTIP

  • Fixed component ID

    5724H7251

Applicable component levels

  • R800 PSY

       UP

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

Document Information

Modified date:
01 June 2017