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
New feature: In
this release several enhancements have been introduced to improve
the administration of message-driven beans:
- You can pause or resume an active message-driven bean deployed
against a service integration bus destination.
- There is increased system awareness and logging of message-driven
bean message delivery failures.
- A message-driven bean is stopped automatically when the number
of sequentially failing messages reaches a limit that you specify.
This helps to distinguish between one or two messages that fail because
of problems with the messages themselves, and a system resource problem
that results in many sequentially failing messages.
newfeat
This task assumes that you have deployed
an enterprise application that contains a message-driven bean (MDB)
, or a business-level application that contains
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, you need the following information:
- The enterprise application that contains the MDB, or the business-level application that contains
the SCA composite.
- The dependent external system resources.
- An acceptable value for the Sequential failed message threshold,
that 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.
- An acceptable value 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.
- An acceptable value 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.
About this task
When an MDB
or SCA composite fails
to process a message, the message is rolled back and made available
to the MDB
or SCA composite again. Typically,
the messaging system is configured in one of the following ways:
- 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.
- Failed messages are retried indefinitely until the problem is
rectified.
Configuration (1) protects the MDB or
SCA composite 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 or SCA composite so that the MDB or SCA composite 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 or SCA composite 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 or SCA composite.
Use the following
steps to protect an enterprise application from dependent external
system resource failures.
Procedure
- Navigate to the deployed enterprise application that contains
the MDB, or the business-level application
that contains the SCA composite.
- From the MDB or SCA composite,
navigate to its JMS activation specification. Click .
- Enter a value for the Sequential failed message threshold and
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, as appropriate:
- Enter a value for the Maximum failed deliveries per message.
- Save your changes to the master configuration.
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 or SCA composite is stopped
automatically when the Sequential failed message threshold 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 or SCA composite. The messages that failed
during the system resource downtime are retried instead of being left
on an exception destination.