The Life Cycle of the Reliable Message Sequence
The following figure shows a one-way reliable message exchange.Figure 5-1 Web Service Reliable Message Exchange
Description of "Figure 5-1 Web Service Reliable Message Exchange"
The Web service client application sends a message for reliable delivery which is transmitted by the RM source to the RM destination. The RM destination acknowledges that the reliable message has been received and delivers it to the Web service application. The message may be retransmitted by the RM source until the acknowledgement is received. The RM destination, if configured to buffer requests, may redeliver the request to the Web service if the Web service fails to process the request.
A Web service client sends messages to a target Web service by invoking methods on the client instance (port or Dispatch instance). A port is associated with the port type of the reliable Web service and represents a programmatic interface to that service. The port is created by the
<clientgen>
child element of the jwsc
Ant task. A Dispatch instance is a loosely-typed, general-purpose interface for delivering whole messages from the client to the Web service. For more information about Dispatch clients, see Developing a Web Service Dispatch Client..WebLogic stores the identifier for the reliable message sequence within this client instance. This causes the reliable message sequence to be connected to a single client instance. All messages that are sent using a given client instance will use the same reliable messaging sequence, regardless of the number of messages that are sent. (Unless you using batching, as described in Grouping Messages into Business Units of Work (Batching).)
Because WebLogic Server retains resources associated with the reliable sequence, it is recommended that you take steps to release these resources in a timely fashion. this can be done by managing the lifecycle of the client instance itself, or by using the
weblogic.wsee.reliability2.api.WsrmClient
API. Use the WsrmClient
API to perform common tasks such as set configuration options, get the sequence id, and terminate a reliable sequence. For more information, see Managing the Life Cycle of a Reliable Message Sequence.Reliable Messaging Failure Recovery Scenarios
The following sections outline reliable messaging failure recovery for various scenarios.- RM Destination Down Before Request Arrives
- RM Source Down After Request is Made
- RM Destination Down After Request Arrives
- Failure Scenarios with Non-buffered Reliable Web Services
RM Destination Down Before Request Arrives
Table 5-3 describes the reliable messaging failure recovery scenario when an RM destination is unavailable before a request from the RM source arrives.It is assumed that Web service buffering is enabled on both the Web service and client. Buffering is enabled on Web service client by default. To configure buffering on the Web service, see Chapter 7, "Configuring Message Buffering for Web Services."
Table 5-3 Reliable Messaging Failure Recovery Scenario—RM Destination Down Before Request Arrives
Transport Type | Scenario Description |
---|---|
Asynchronous Transport |
|
Synchronous Transport |
Note: To achieve true reliability with synchronous transport, it is recommended that you use MakeConnection. For more information, see Using Asynchronous Web Service Clients From Behind a Firewall (MakeConnection). |
RM Source Down After Request is Made
Table 5-4 describes the reliable messaging failure recovery scenario when an RM source goes down after a request is made.It is assumed that Web service buffering is enabled on both the Web service and client. Buffering is enabled on Web service clients by default. To configure buffering on the Web service, see Chapter 7, "Configuring Message Buffering for Web Services."
Table 5-4 Reliable Messaging Failure Recovery Scenario—RM Source Down After Request is Made
Transport Type | Scenario Description |
---|---|
Asynchronous Transport |
|
Synchronous Transport |
Note: To achieve true reliability with synchronous transport, it is recommended that you use MakeConnection. For more information, see Using Asynchronous Web Service Clients From Behind a Firewall (MakeConnection). |
RM Destination Down After Request Arrives
Table 5-5 describes the reliable messaging failure recovery scenario when an RM destination is unavailable after a request has been accepted from the RM source.It is assumed that Web service buffering is enabled on both the Web service and client. Buffering is enabled on Web service client by default. To configure buffering on the Web service, see Chapter 7, "Configuring Message Buffering for Web Services."
Table 5-5 Reliable Messaging Failure Recovery Scenario—RM Destination Down After Request Arrives
Transport Type | Scenario Description |
---|---|
Asynchronous Transport |
|
Synchronous Transport | Note: If you attempt to invoke a buffered Web service using synchronous transport, one of following will result:
|
Failure Scenarios with Non-buffered Reliable Web Services
A non-buffered Web service operates differently than a buffered Web service in that it does not buffer a request to hardened storage before acknowledging it and attempting to process it. A non-buffered Web service will not attempt to reprocess a request if the service logic fails, whereas a buffered Web service will attempt to reprocess the request. In both cases, buffered or non-buffered, any response generated by the Web service will be buffered before it is sent back to the client.A non-buffered Web service may be useful in the following cases:
- Web service operates against non-transactional resources and should not process any request more than once (because rolling back the transaction that dequeued the buffered request cannot roll back the side effects of the non-transactional service).
- Web service is relatively light weight, and does not take very long to process requests.
- Web service performance is of paramount importance and risk of losing request or response is acceptable. Non-buffered Web services will not incur the overhead of buffering the request to a store, and thus can deliver better throughput than a buffered Web service. The performance gain is dependent on how much time and resources are required to buffer the requests (for example, very large request messages may take significant time and resources to buffer).
- The request is accepted for processing.
- The response from the Web service is registered for delivery to the client (RM source).
Carefully consider this failure window before configuring a Web service to run as non-buffered.
No comments:
Post a Comment