uCosminexus Service Platform, Overview

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

2.5.3 Handling response messages when a synchronous service component is invoked

Asynchronous (MDB (DB queue)) standard reception 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 Services or Session Bean) or business process is requested from asynchronous (MDB (DB queue)) 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 shared send queue at the HCSC server side when setting up the environment of the HCSC server, and specify the send destination queue name for the shared send queue.

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

The message is transmitted from the shared send queue to the database queue (shared receive queue) of the service requester side. Therefore, you can acquire the response message from the service component by extracting the message from the database queue (shared receive queue).

For details about how to extract responses, see 8.6.10 Extracting responses (TP1/EE and JMS) in the Service Platform Basic Development Guide.

The following figure shows how a response is handled when a synchronous service component is invoked.

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

[Figure]

Messages are output to the response queue in the cases shown in the table below.

Even for a synchronous service component, messages are sent to the response queue in the format shown below depending on whether a response exists.

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-3 Cases when messages are output in the response queue

No. Cases when messages are output in 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, Session Bean, or custom adapter) A response message set in the payload is sent. A message without the 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 the 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. (The message KDEC00031-W indicating that the response message was discarded is output.)

Unlike the case of an MDB (WS-R), the JMS properties cannot be inherited. To set up a correlation for service component invocation, you need to embed the information showing the correlation within the user message.