Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Using WS-Reliable Messaging

In order for a client/server to communicate reliably with its target endpoint/its clients, the CXF WS-Reliable Messaging interceptors need to be in the interceptor chain for inbound and outbound messages and faults. Also, because WS-Reliable Messaging depends on WS-Addressing, the CXF WS-Addressing interceptors need to be on these interceptor chains also.
The WS-Reliable Messaging implementation consists of 4 interceptors in total, but depending on which of the approaches oulined below you choose to enable the use of reliable messaging, you need not know what they are and which interceptor chain they should be added to.

It is important to note at this point that the presence of these interceptors alone will take care of exchanging the RM protocol messages when necessary. For example. upon processing the first application message on the outbound interceptor chain, the RM interceptors will ensure that a CreateSequence request is sent and not proceed with processing the original application message until the CreateSequenceResponse was received. Furthermore, the RM interceptors are responsible for adding the Sequence headers to the application messages and, on the destination side, extracting them from the message.
No changes to application code are required to make the message exchange reliable! And while by default, CXF attempts to maximize the lifetime of a sequence, thus reducing the overhead incurred by the RM protocol messages, you can control the behavior of these interceptors by setting their sequence termination policies (e.g. the maximum sequence length), and acknowledgment policies (e.g. send an out-of-band acknowledgment if no application messages was received in the last n seconds).To make a message exchange between two endpoints reliable, you need to ensure that the RM interceptors and (as WS-Reliable messaging has a dependency on WS-Addressing) the addressing interceptors are added to the interceptor chains. This can be achieved in one of the following ways:

Using the RMAssertion and the CXF WS-Policy Framework

...