Manage message delivery for message-driven beans (MDB)
that are deployed as message endpoints. The message endpoints are
managed beans (MBeans) for inbound resource adapters that are compliant
with Java Platform, Enterprise Edition (Java EE) Connector Architecture (JCA) Version
1.5.
About this task
The application server provides message endpoint MBeans to
assist you in managing the delivery of a message to your message-driven
beans that are acting as listeners on specific endpoints, which are
destinations, and in managing the enterprise information system (EIS)
resources that are utilized by these message-driven beans. Message-driven
beans that are deployed as message endpoints are not the same as message-driven
beans that are configured against a listener port. Message-driven
beans that are used as message endpoints must be deployed using an
ActivationSpecification that is defined within a resource adapter
configuration for JCA Version 1.5.
With message endpoint MBeans,
you can activate and deactivate specific endpoints within your applications
to ensure that messages are delivered only to listening message-driven
beans that are interacting with healthy EIS resources. This capability
allows you to optimize the performance of your JMS applications in
situations where an EIS resource is not behaving as expected. Message
delivery to an endpoint typically fails when the message driven bean
that is listening invokes an operation against a resource that is
not healthy. For example, a messaging provider, which is an inbound
resource adapter that is JCA Version 1.5 compliant, might fail to
deliver messages to an endpoint when its underlying message-driven
bean attempts to commit transactions against a database server that
is not responding.
Note: Design your message-driven beans to delegate
business processing to other enterprise beans. Do not access the EIS
resources directly in the message-driven bean, but do so indirectly
through a delegate bean.
Message endpoint MBeans alleviate
two problems that are inherent to applications that provide message
endpoints that access resources:
- Failed messages require additional processing, such as delivering
them to the listening endpoint again or redirecting them to alternate
destinations that process failed messages. In addition, a resource
adapter might redeliver a message to an endpoint an infinite number
of times.
- Message redirection requires the implementation of specialized
destinations (queues and listeners) to process failed messages, as
well as the logic to detect message failures. Message redirection
is potentially error prone and computationally expensive due to its
complexity.
The capability to deactivate (pause) and reactivate (resume)
a specific message endpoint alleviates these problems by enabling
the administrator to deactivate the endpoint from processing messages
that are destined to fail. When the message endpoint is deactivated,
you can repair the resource that is causing the problems and reactivate
the endpoint to resume handling message requests. In the course of
troubleshooting, you will not affect the resource adapter or the application
that is hosting the endpoint.
If you
are connecting to WebSphere® MQ, you can also
use the WAS_EndpointInitialState custom property in the activation
specification to make the message endpoint start out in a deactivated
state. When you set this property to Inactive, the message-driven
bean connects with the destination, but does not start receiving messages.
Use this setting to automatically deactivate a message endpoint when
you know that certain tasks must be completed, services must be started,
or checks must be carried out, before message handling begins. You
activate the message endpoint in the same way as you would reactivate
a message endpoint that you paused during its operation.