Show Table of Contents
19.2. WS-RM Interceptors
In Apache CXF, WS-RM functionality is implemented as interceptors. The Apache CXF runtime uses interceptors to intercept and work with the raw messages that are being sent and received. When a transport receives a message, it creates a message object and sends that message through an interceptor chain. If the application's interceptor chain includes the WS-RM interceptors, the application can participate in reliable messaging sessions. The WS-RM interceptors handle the collection and aggregation of the message chunks. They also handle all of the acknowledgement and retransmission logic.
Apache CXF WS-RM Interceptors
The Apache CXF WS-RM implementation consists of four interceptors, which are described in Table 19.1, “Apache CXF WS-ReliableMessaging Interceptors”.
Table 19.1. Apache CXF WS-ReliableMessaging Interceptors
Deals with the logical aspects of providing reliability guarantees for outgoing messages.
Responsible for sending the
Also responsible for aggregating the sequence properties—ID and message number—for an application message.
|Responsible for intercepting and processing RM protocol messages and |
| || |
Caching incoming messages for persistent storage.
| || |
Assuring InOrder delivery of messages to the application.
|Responsible for encoding and decoding the reliability properties as SOAP headers.|
|Responsible for creating copies of application messages for future resending.|
The presence of the WS-RM interceptors on the interceptor chains ensures that WS-RM protocol messages are exchanged when necessary. For example, when intercepting the first application message on the outbound interceptor chain, the
CreateSequencerequest and waits to process the original application message until it receives the
CreateSequenceResponseresponse. In addition, the WS-RM interceptors add the sequence headers to the application messages and, on the destination side, extract them from the messages. It is not necessary to make any changes to your application code to make the exchange of messages reliable.
For more information on how to enable WS-RM, see Section 19.3, “Enabling WS-RM”.
Configuring WS-RM Attributes
You control sequence demarcation and other aspects of the reliable exchange through configuration. For example, by default Apache CXF attempts to maximize the lifetime of a sequence, thus reducing the overhead incurred by the out-of-band WS-RM protocol messages. To enforce the use of a separate sequence per application message configure the WS-RM source’s sequence termination policy (setting the maximum sequence length to
For more information on configuring WS-RM behavior, see Section 19.5, “Configuring WS-RM”.