+

Search Tips   |   Advanced Search

Example: Code for waiting for a sequence to complete


Your client application can use the WSRMSequenceManager, part of the WAS SPI for reliable messaging, to gain programmatic control over reliable messaging sequences. Use the waitUntilSequenceCompleted method on the sequenceManager to ensure that reliable messaging state is released after the client finishes messaging.

The WAS SPI for reliable messaging always uses the static policy set configuration that is applied to the client from which the SPI is called. It does not use any alternative policy set that is subsequently configured by WS-Policy to meet the requirements of a WS-Policy intersection.

For the client application to gain programmatic control over reliable messaging sequences, it needs access to a WSRMSequenceManager instance. For information and example code explaining how to achieve this, see Controlling WS-ReliableMessaging sequences programmatically.

 

Example

To wait for a reliable messaging sequence to complete, you use a method call that ensures that all messages have been sent and acknowledged by the target service. After the sequence is completed, it is terminated and cleaned up. By closing sequences programmatically, you limit the number of open sequences a single client has to support in a single JVM at one time.

There are two ways of using the waitUntilSequenceCompleted method:





 

Related tasks


Learn about WS-ReliableMessaging
Controlling WS-ReliableMessaging sequences programmatically

 

Related


Example: Code for creating a sequence
Example: Code for sending an acknowledgement request
Example: Code for closing a sequence
Example: Code for terminating a sequence