Tuesday, October 11, 2011

WS-Notification implementation

Since the early days, Apache ServiceMix has had an implementation of the Oasis WS-Notification specifications. This implementation was built on top of Apache ActiveMQ and available inside the JBI bus as a service. Now that JBI is being put aside in ServiceMix, some questions arose about the future of this component.

So last week, I took a stab at rewriting the component using pure JAX-WS services. For those that are not familiar with WS-Notification, this specification, unlike most other WS-* specifications defines a service described by a WSDL, so there's no low level protocol implementation to write. I took most of the code from ServiceMix implementation and just rewrote the JBI specific bits to leverage JAX-WS instead.

The results have been committed into Apache CXF and should be part of the upcoming 2.5 release. Note that the implementation itself does not require CXF, though it can very well use it as the JAXWS provider.

If you want to give it a try, you need to build CXF trunk locally and then run the following commands in Karaf:

To check that the WS-Notification broker is correctly started, you can try the following command:

karaf> cat http://0.0.0.0:8182/wsn/NotificationBroker?wsdl
...

The services are also exposed as OSGi services, so that they can be directly accessed if needed. If you use the awesome Fabric DOSGi implementation, it can be very interesting.

Some areas could still be enhanced, as the codebase is mostly the same as the old ServiceMix component. I'm thinking to complex topic expressions or persistence of subscriptions. If you have any real need for something, send an email to the CXF mailing lists ...

8 comments:

Hi Guillaume,Thanks for the post. I was waiting for a wsn implementation for a while now, after muse retired. Happy to see cxf took over. This is my question. How can I create a wsn notification consumer endpoint with CXFservlet in, say, a tomcat container with spring configuration file. Thanks,Paul

Thanks for all of the great posts Guillaume. On my client we are trying to implement federated brokers (brokers notify/subscribe to each other) and users only interact with their local brokers. It seems no one has done this before. Any thoughts?

tachiHello Again Guillaume, We are looking to extend the JAX-WS implementation you did for CXF to support WS-Reliable Messaging and Broker Federation. Any suggestions/tips on how to go about starting this task?

Hello Again Guillaume, We are looking to extend the JAX-WS implementation you did for CXF to support WS-Reliable Messaging and Broker Federation. Any suggestions/tips on how to go about starting this task?