Protecting an MDB application from system resource problems

You can configure the system so that if there is a problem with a dependent external system resource, the enterprise application is stopped before messages are moved unnecessarily to an exception destination. This configuration also handles occasional problems with messages without blocking the enterprise application.

Before you begin

This task assumes that you have deployed an enterprise application that contains a message-driven bean (MDB) that interacts with external system resources.

The destination to which the MDB listens must use an exception destination. This exception destination can be the system default, or one configured specifically for the destination.

To complete this task, you need the following information:
  • The enterprise application that contains the MDB.
  • The dependent external system resources.
  • An acceptable value for the 循序失敗訊息臨界值, that is, the maximum number of sequential failures of delivery of messages, after which the MDB is stopped. This property applies to sets of messages.
  • An acceptable value for the 失敗訊息重試的延遲間隔, that is, the time in milliseconds before a failing message is available to be delivered to the MDB. Other messages might be delivered during this period, unless the 循序失敗訊息臨界值 and the maximum concurrency is set to 1.
  • An acceptable value for the 每個訊息的失敗遞送次數上限, that is, the maximum number of failed attempts to process a message, after which the message is forwarded from its intended destination to the exception destination. This property applies to individual messages.

About this task

When an MDB fails to process a message, the message is rolled back and made available to the MDB again. Typically, the messaging system is configured in one of the following ways:
  1. Failed messages are retried a finite number of times, and if they continue to fail, they are moved to an exception destination allowing subsequent messages to be processed.
  2. Failed messages are retried indefinitely until the problem is rectified.

Configuration (1) protects the MDB from an occasional problem message that prevents subsequent messages from being processed. However, if there is a prolonged problem with a resource that the enterprise application or business-level application depends on, for example a database, all messages that are sent to the destination might be moved to the exception destination.

Configuration (2) blocks the delivery of messages until the original failing message problem is resolved. This configuration prevents messages being moved unnecessarily to an exception destination, but it also blocks subsequent messages as soon as a single problem message fails to be processed.

You can configure the activation specification for an MDB so that the MDB endpoint is stopped automatically when a number of failures with sequential messages are detected. These failures indicate a problem with a dependent resource. When the problem is resolved, the MDB endpoint is restarted manually. This configuration tolerates occasional message failures, allowing individual problem messages to be moved to the exception destination without blocking the entire MDB.

Use the following steps to protect an enterprise application from dependent external system resource failures.

Procedure

  1. Navigate to the deployed enterprise application that contains the MDB.
  2. From the MDB, navigate to its JMS activation specification. Click 資源 -> JMS -> 啟動規格 -> activation_specification_name.
  3. Enter a value for the 循序失敗訊息臨界值 and the 失敗訊息重試的延遲間隔.
  4. Save the configuration.
  5. Navigate to the destination to which the MDB is listening. Click one of the following paths, as appropriate:
    • 服務整合 -> 匯流排 -> bus_name -> [目的地資源] 目的地 -> queue_name
    • 服務整合 -> 匯流排 -> bus_name -> [目的地資源] 目的地 -> topic_space_name
  6. Enter a value for the 每個訊息的失敗遞送次數上限.
  7. 儲存對主要配置所做的變更。

Results

You have configured the enterprise application, or business-level application, to protect itself from the sort of external resource problem that can occur at any time. This means that, in the event of a system resource problem, the MDB is stopped automatically when the 循序失敗訊息臨界值 is reached for any message.

What to do next

When the system resource that failed becomes available, you can restart the system resource and resume the MDB. The messages that failed during the system resource downtime are retried instead of being left on an exception destination.

指出主題類型的圖示 作業主題



時間戳記圖示 前次更新: July 9, 2016 11:15
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=tjn_mdb_0001
檔名:tjn_mdb_0001.html