Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

For compatibility with older versions of CXF, the default is to use the February 2005 submission version of RM with the submission version of WS-Addressing. On the client side, you can configure CXF for whichever version of WS-ReliableMessaging you want to use (see Reliable Messaging Configuration Guide, along with the Runtime control properties below). On the provider side, CXF adapts to whichever version of WS-ReliableMessaging is used by the client and responds appropriately.

...

Interceptor

Task

org.apache.cxf.ws.rm.RMOutInterceptor

Responsible for sending CreateSequence requests and waiting for their CreateSequenceResponse responses, and and aggregating the sequence properties (id and message number) for an application message.

org.apache.cxf.ws.rm.RMInInterceptor

Intercepting and processing RM protocol messages (these will not the application level), as well as SequenceAcknowledgments piggybacked on application messages.

org.apache.cxf.ws.rm.RMCaptureInInterceptor

Caching incoming messages for later retransmissionpersistent storage.

org.apache.cxf.ws.rm.RMDeliveryInterceptor

Assuring InOrder delivery of messages to the application.

org.apache.cxf.ws.rm.soap.RMSoapInterceptor

Encoding and decoding the RM headers

org.apache.cxf.ws.rm.soap.RetransmissionInterceptor

Responsible for creating copies of application messages for future resends.

...

Code Block
    private static class AcknowledgementListener implements NotificationListener {
        private volatile long lastAcknowledgement;
        
        @Override
        public void handleNotification(Notification notification, Object handback) {
            if (notification instanceof AcknowledgementNotification) {
                AcknowledgementNotification ack = (AcknowledgementNotification)notification;
                lastAcknowledgement = ack.getMessageNumber();
            }
        }
     }
        // initialize client
    ...
        // attach to JMX bean for notifications
        //  NOTE: you must have sent at least one message to initialize RM before executing this code
        Endpoint ep = ClientProxy.getClient(client).getEndpoint();
        InstrumentationManager im = bus.getExtension(InstrumentationManager.class);
        MBeanServer mbs = im.getMBeanServer();
        RMManager clientManager = bus.getExtension(RMManager.class);
        ObjectName name = RMUtils.getManagedObjectName(clientManager, ep);
        System.out.println("Looking for endpoint name " + name);
        AcknowledgementListener listener = new AcknowledgementListener();
        mbs.addNotificationListener(name, listener, null, null);
        
        // send messages using RM with acknowledgement status reported to listener
    ...