IBM Support

MDB listener retries

Question & Answer


Question

What will allow a Message-driven bean (MDB) listener to recover from a failure?

Cause

For example:

1. A listener port fails due to an MQException with a non-zero reason code. For example, WebSphere Application Server (WSAS) is restarted while the WebSphere MQ (WMQ) queue associated with an MDB listener is 'get disabled'. Reason code 2016 (MQRC_GET_INHIBITED) is returned to the listener. When the queue is enabled for gets, the listener port still does not connect and has to be manually cycled. The listener port status appears started but no connection handles are present in MQ until the listener port is cycled.


2. The listener is working but then fails with
BBOO0222I: WMSG0036E Maximum message delivery retry count of
0 reached for MDB <MDB name>, JMSDestination <queue>,
MDBListener stopped


The listener has most likely encountered a poison message.


3. When the WebSphere MQ v7 Resource Adapter (RA) is connecting to a
WebSphere MQ v6 queue manager, MDBs will not reconnect to the queue manager if the queue manager is recycled or the channel is stopped and restarted. WebSphere Application Server V7 uses the WMQ V7 RA.

Answer

1. Refer to Message listener service custom properties. Review the settings for:

  • DYNAMIC.CONFIGURATION.ENABLED
    Allows a listener port to be defined and started without the need of the server restart.
    This property was added in WebSphere Application Server Fix Pack 6.0.2.17 and 6.1.0.7.

  • ENABLE.ZOS.LP.RECOVERY
    Allows WebSphere Application Server to detect a problem with WMQ and attempt to create a new connection.
    This property was added in WebSphere Application Server Fix Pack 6.0.2.27 and 6.1.0.16.

  • MAX.RECOVERY.RETRIES
    The maximum number of attempts to start the MDB listener.

  • RECOVERY.RETRY.INTERVAL
    The time that will elapse between retry attempts (in seconds).


    Verifying the property settings:

  • To confirm the ENABLE.ZOS.LP.RECOVERY setting, you can enable the following single-class trace string during startup of the application server:

    • com.ibm.ejs.jms.listener.ListenerPortMBeanProxy=all

    Check the control region job logs for the following text

      "ZOS LP recovery enabled"

    This class only outputs trace during startup and when a listener port is stopped/restarted.
    As such, there is minimal impact in leaving the trace string enabled.

  • To confirm that retry processing has taken place after a connection has broken, review the control region joblog. The control region contains the part of the WAS message listener that listens for new messages arriving on queues. The servant regions simply drive the onMessage method of the MDB when told to by the control region.

    Here is an example of control region messages during restart of a queue manager with ENABLE.ZOS.LP.RECOVERY enabled:

  • BBOJ0098E: MDB PROBLEM: JMSEXCEPTION CAUGHT IN CONTROLLER.  EXCEPTION: javax.jms.JMSException: MQJMS1025: failed to browse message
      at com.ibm.mq.jms.services.ConfigEnvironment.newException(ConfigEnvironment.java:595)
      at com.ibm.mq.jms.MQQueueAgentThread1Impl.browse(MQQueueAgentThread1Impl.java:279)
      at com.ibm.mq.jms.MQQueueAgentThread.run(MQQueueAgentThread.java:1754)
      at java.lang.Thread.run(Thread.java:810)

    BBOJ0101I: MDB LISTENER STOPPED SUCCESSFULLY FOR MDB: EchoMDBEar#EchoMDB.jar#EchoMDB, LISTENER PORT: M600Q1Listener, DESTINATION: queue:///Q1

    BBOJ0102I: MDB LISTENER FOR MDB: EchoMDBEar#EchoMDB.jar#EchoMDB, LISTENER PORT: M600Q1Listener WILL ATTEMPT TO RESTART IN 60 SECONDS.  RECOVERY COUNT = 1.

    BBOJ0100I: MDB LISTENER STARTED SUCCESSFULLY FOR MDB: EchoMDBEar#EchoMDB.jar#EchoMDB, LISTENER PORT: M600Q1Listener, DESTINATION: queue:///Q1


2. Set the backout threshold property (BOTHRESH) on the queue to a value lower than the Maximum retries property on the listener port. That causes MQ JMS to move the bad message off the queue before the listener gives up and shuts down.


Related links:

[{"Product":{"code":"SSFKSJ","label":"WebSphere MQ"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Java","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"9.0;8.0;7.1;7.0.1;7.0;6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}},{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"JSP","Platform":[{"code":"PF035","label":"z\/OS"}],"Version":"9.0;8.5;8.0;7.0;6.1;6.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Product Synonym

IBM MQ WebSphere MQ WMQ

Document Information

Modified date:
22 June 2018

UID

swg21377728