Extended messaging builds on the base support for JMS messaging and message-driven
beans provided by WebSphere Application Server. The new messaging components
for extended messaging are referred to as the Message Bean package.
Components for receiving messages
The following
components, shown in the figure Components for receiving messages, are used to receive messages:
- Receiver bean
- An application that uses extended messaging can
receive messages by using a receiver bean (using the onMessage()
method of a message-driven bean) or an application-callable receiver
bean (a stateless session bean that polls for a message from a named
destination). Both receiver beans and application-callable receiver beans
can receive and process asynchronous messages, and optionally return selected
data as a response message.
- Input port
- An input port specifies the properties needed by receiver
beans as session beans, by defining the following information:
- Information about the source destination for the message to be received
- Information about how to select and handle the message received
- Optional information about a reply destination, which is used if a reply
is expected and replyTo information is not present in the JMSHeader of the
message received.
A receiver bean as a deployed message-driven bean uses the associated
listener port, so does not need an input port. For more information about
message-driven beans and listener ports, see Message-driven beans - components.
For more conceptual information about receiving messages, see Extended messaging - receiving messages.
Components for receiving messages. This figure shows an application calling a receiver bean (as a session
bean) to receive messages from the JMS destination defined on an input port.
The application also calls the ReplySender() method of the receiver bean to
send a reply to the original message received. For more information about
what is shown in this figure, see the text that accompanies this figure.
Components for sending messages
The following components,
shown in the figure Components for sending messages, are used to send messages:
- Sender bean
- Bean instances of a sender bean (also known as a message
sender bean) can send asynchronous messages. The sender bean methods
can be passed either a JMS message or a number of parameters that are mapped
by extended messaging into a JMS message, which is then passed to JMS.
- Output port
- An output port specifies the properties needed by
sender beans, to define the destination for the message being sent, and other
optional properties if a response is expected. It is associated with the Sender
Bean at deployment time and contains the following information:
- Information about the target destination for the message to be sent
- Information about how to select and handle the message to be sent
- Information about the destination used for the response.
For more conceptual information about sending messages, see Sending messages with
extended messaging.
Components for sending messages. This figure shows an application calling a sender bean to send messages
to the JMS destination defined on an output port. The application also calls
the receiveResponse() method of the sender bean to receive a reply to the original
message sent. For more information about what is shown in this figure, see
the text that accompanies this figure.