Configuring MDB throttle support

Message driven bean (MDB) throttle support controls the flow of work requests (WRs) into the WLM queue. The WRs result from messages being placed into a JMS destination. The MDB throttle allows or blocks a WR from being queued based on the maximum sessions set for the Listener Port and the current amount of in-flight requests. For more information on MDB throttle support, refer to MDB throttle support.
Configuring MDB throttle support involves listener port settings, connection factory settings, and MQ property settings. The proper setting of these properties will result in a configuration that handles message processing satisfactorily.
  1. Set the listener port maximum sessions property. The value of this property determines the high threshold value (high threshold = maximum sessions) and is used by the throttle to decide when to block or allow requests.
    1. To view this administrative console page, click Servers-> Application Servers-> application_server-> Message Listener Service-> Listener Ports-> listener_port
    2. Set the maximum sessions property to the value you want the MDB throttle to use as its high threshold value. A good initial value for this setting is 100. The throttle also uses this value to compute the low threshold value. The actual number of server sessions is limited by the number of worker threads in the servant region and by the connection factory session pool max connections property.
  2. Set the WebSphere MQ Queue Connection Factory properties.
    1. To view this administrative console page, click Resources-> WebSphere MQ JMS Provider-> WebSphere MQ Queue Connection Factories (under additional properties)
    2. Select the Connection Factory specified for the Listener Port.
    3. Under the Additional Properties, activate the Connection Pool panel.
    4. Set the Max Connections property for the Connection Pool. This property may be set to the total amount of connections that will be created. We recommend setting it to at least the number of worker threads available to the servant region.
    5. Under Additional Properties of the Connection Factory, activate the Session Pool panel.
    6. Set the Max Connections property for the Session Pool. This property may be set to the total amount of sessions that will be created or used concurrently from a single connection. This allows sessions to be readily available and reduces the probability of having to wait for a session to become available in order to do message processing. If the value is less than the Listener Port Maximum sessions property and the number of worker threads, then the throttle might request more sessions than there are available. This would result in one or more requests having to wait for a session to become free, which could have an undesirable effect on concurrent processing of requests.
  3. Set the MQ related properties. The properties discussed in this section pertain to properties that have an effect on the number of messages in the destination and the number of connections to the queue manager. These properties include the MQ Backout Count Threshold (BOTHRESH), IDBACK, and IDFORE. For more information on these MQ settings, refer to:
    • WebSphere MQ Script Command (MQSC) Reference Book (SC34-6055-03)
    • WebSphere MQ Problem Determination Guide (GC34-6054-01).
    1. Set the MQ Backout Count Threshold (BOTHRESH) to a value less than the Listener Port Maximum retries property. If the BOTHRESH value is greater than the Listener Port Maximum retries value, then the Listener Port will be stopped for excessive message roll backs as in the case of poison messages, and the corrupted message will still remain in the destination.

      Setting this property to a value less than the Listener Port Maximum retries value prevents the same message from remaining in the destination after the message has been rolled back the specified number of times. Reaching this count threshold causes the message to be placed into the backout queue, which helps reduce the number of messages in the destination. Only the required number of Work Requests are created for the healthy messages, therefore improving resources utilization and performance.

    2. Set CTHREAD to the maximum number of connections from batch, CICS, IMS, and TSO tasks to a single instance of WebSphere MQ. This can be thought of as the total of connections available to WebSphere MQ. Make sure that the total of the IDBACK and IDFORE properties discussed in the next two substeps do not exceed this value.
    3. Set IDBACK to the maximum number of connections to a single instance of WebSphere MQ from batch or TSO background tasks. The number of connections to the queue manager impact performance. Choose the minimal number of connections that allows satisfactory message processing.
    4. Set IDFORE to the maximum number of connections to a single instance of WebSphere MQ from TSO foreground tasks. The number of connections to the queue manager impact performance. Choose the minimal number of connections that allows satisfactory message processing.
To set the MDB throttle to allow 100 messages to be queued before blocking message retrieval on a server with 40 Worker Threads, two connections (one for serving the MDBs and one per MDB instance for sending a reply message from the MDB's onMessage method), and a Listener Port maximum retries set to 5, set the following properties:
  1. Set the Listener Port Maximum sessions property to 100. This automatically sets the throttle High Threshold to 100.
  2. Set the Connection Factory’s Connection Pool to have enough connections by setting the Max Connections property to the minimum of both the Maximum sessions and the Max Connections, 40 in this case.

    The number of worker threads limits the amount of server sessions available. Therefore, assuming the advanced ORB setting of LONGWAIT (40 threads), the server session pool will be set to allow at most 40 server sessions to be created.

  3. Set the Max Connections property for the Connection Pool Connection Factory Session Pool to have enough sessions by setting the Max Connections property to the amount of concurrent sessions to be used during message processing.

    In this example, there can be at most 40 MDB instances, and a total of 1 session is needed per MDB instance, then the property should be set to 40.

  4. Set the MQ BOTHRESH property to less than the Listener Port Maximum retries property.
  5. Set the CTHREAD value higher than 40.

    For the CTHREAD, IDBACK, and IDFORE the total number of connections and how they are used must be taken into consideration. In this example, at most 40 connections could be made to WebSphere MQ from the Connection Factory, so CTHREAD should be higher than this value.