Example 3: The system experiences problems with a problem message
To prepare for a problem message, configure the system to move that message to an exception destination and allow other messages to be processed successfully.
This task assumes that we have deployed an enterprise application containing a message-driven bean (MDB), or a business-level application containing a Service Component Architecture (SCA) composite, that interacts with external system resources.
The destination to which the MDB or SCA composite 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, we need the following information:
- The enterprise application containing the MDB, or the business-level application containing the SCA composite.
- The dependent external system resources.
- Set a value of 3 for the Sequential failed message threshold. This is the maximum number of sequential failures of delivery of messages, after which the MDB or SCA composite is stopped. This property applies to sets of messages.
- Set a value of 5000 for the Delay between failing message retries, that is, the time in milliseconds before a failing message is available to be delivered to the MDB or SCA composite. Other messages might be delivered during this period, unless theSequential failed message threshold and the maximum concurrency is set to 1.
- Set a value of 5 for the Maximum failed deliveries per message, 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.
In this scenario, the enterprise application is a continuously running system that uses a deployed MDB or SCA composite to access an external system resource.
When a problem message (msg1 in this scenario) is encountered, it is put back on the queue.
Instead of msg1 being made available to the MDB or SCA composite immediately, it is hidden for the Delay between failing message retries retry delay of five seconds.
The next message on the queue (msg2) is processed by the MDB or SCA composite. This message and subsequent messages succeeds.
When the Delay between failing message retries for msg1 expires, msg1 is unhidden and reprocessed. It is put back on the queue again.
The MDB or SCA composite continues to process subsequent messages normally but each time msg1 is processed, it is put back on the queue.
When the number of times msg1 has been unhidden, rolled back and rehidden reaches the Maximum failed deliveries per message limit (five times in this scenario), it is moved to the configured exception destination.
- Navigate to the deployed enterprise application containing the MDB or SCA composite.
- From the MDB or SCA composite, navigate to its JMS activation specification. Click Resources -> JMS -> Activation specifications -> activation_specification_name.
- Enter a value of 3 for the Sequential failed message threshold.
- Enter a value of 5000 for the Delay between failing message retries.
- Save the configuration.
- Navigate to the destination to which the MDB or SCA composite is listening. Click one of the following paths, as appropriate:
- Service integration -> Buses -> bus_name -> [Destination resources] Destinations -> queue_name
- Service integration -> Buses -> bus_name -> [Destination resources] Destinations -> topic_space_name
- Enter a value of 5 for the Maximum failed deliveries per message.
- Save the changes to the master configuration..
Results
You have configured the system to protect itself from external resource failures and send problem messages to the exception destination.