uCosminexus Service Platform, Overview

[Contents][Glossary][Index][Back][Next]

2.4.3 Handling response messages when a synchronous service component is invoked

Standard reception (MDB (WS-R)) is provided for asynchronous request messages and is basically used when no response is sent from the service component. However, if a synchronous service component (such as Web Service or Session Bean) or business process is requested from asynchronous (MDB (WS-R)) standard reception, a response might be returned from the synchronous service component. Therefore, the HCSC server provides a way to send the response to a response queue.

To use the response queue, create a transmit queue (response queue) at the HCSC server side when setting up the environment of the HCSC server. Then, for the transmit queue, specify the destination address of the Web application used for inter-queue transfer on the service requester machine and the transmit destination queue name.

When sending a request for invoking a service component from the service requester to standard reception (MDB (WS-R)), specify the name of the created transmit queue (response queue) in the parameters of standard reception (MDB (WS-R)). This specification causes a JMS message to be sent to the specified queue when a response is returned from the service component.

The JMS message sent to the transmit queue (response queue) is transmitted to the local queue of the service requester side. Therefore, the service requester can acquire the response message from the service component by extracting the message from the local queue. The following figure shows how a response is handled when a synchronous service component is invoked.

Figure 2-36 Response handling when a synchronous service component is invoked

[Figure]

For details about how to extract responses, see 8.5.8 Extracting responses in the Service Platform Basic Development Guide.

  

Even for a synchronous service component, whether a message is to be sent to the response queue differs depending on whether a response exists, as shown in the table below.

Note that even if the response queue name is specified by the service requester, messages cannot be sent to the response queue if a queue with the specified name is not created at the HCSC server side. In this case, an error occurs during the service component invocation process.

Table 2-1 Cases when messages are output to the response queue

No. Cases when messages are output to the response queue Existence of a response message
A response message exists No response message exists A user-defined exception occurs from the service component An error other than a user-defined exception occurs
1 If the invoked service component is a synchronous service component
(such as Web Service or Session Bean)
A response message set in the payload is sent. A message without a payload is sent. A response message set in the payload is sent. N#
2 If the invoked service component is an asynchronous service component
(such as an MDB (WS-R) and MDB (DB queue))
N N -- N#
3 If the invoked service component is a business process A response message set in the payload is sent. A message without a payload is sent. A response message set in the payload is sent. N#

Legend:
N: No message is sent.
--: Not applicable because a user-defined exception is not generated from an asynchronous service component.

#
Error information is output to the log and trace.

If the response queue name is not specified in the request from the service requester, the contents of the response message will be discarded (when the response message is discarded, the message KDEC00031-W is output).

To set up a correlation on the service requester side, the JMS property specified by the service requester is inherited. For details about the inherited header and properties, see 8.5.8 Extracting responses in the Service Platform Basic Development Guide.