To send messages, applications that use extended messaging call a method
on a sender bean. A sender bean turns its method invocation into
a JMS message, then passes that message to JMS. If needed, the sender bean
can retrieve a response message, then translate that message into a result
value and return it to the caller. If data mapping is used, the method that
invokes a sender bean is unaware of the original JMS message. The sender bean
methods can use data mapping to build JMS messages from data passed on the
method call.
A sender bean is an enterprise bean (stateless session bean) that can be built by WebSphere Studio Application Developer. A sender bean should not contain any application logic, to help preserve the separation between the messaging and business logic.
Each method defined on a class that implements a sender bean has one of the following modes of interaction (which is defined when the sender bean is built). The interaction extends the sender interface to address the issue of synchronizing anonymous invocations.
To send a JMS message, an application invokes the sender bean's method. The caller of the sender bean's method cannot receive a response to the message sent. This mode of interaction can be used with point-to-point or publish/subscribe messaging.
To send a JMS message and wait for a synchronous response, an application invokes the sender bean's method. The sender bean uses the message sender (an interface to JMS provided by extended messaging) to send the message and, when the response is received, to return the response message to the caller of the sender bean. This mode of interaction can be used with point-to-point messaging only.
To send a JMS message and wait for a deferred response, an application invokes the sender bean's method. The sender bean uses the message sender to send the message, then returns to the caller without waiting for the response. The response is returned by a generated receiveResponse() method. This mode of interaction enables an application to receive more than one response message, as the application is responsible for retrieving the responses. This mode of interaction can be used with point-to-point messaging only.