Over the weekend I did some bigger refactorings for the Apache CXF JMS transport to prepare it for the new configuration model. When I started the JMS code was really difficult to read. The code used callbacks at several places and jumped around between Classes and their subclasses.
I have done a first refactoring in issue CXF-1773. The biggest improvement was getting rid of the class JMSTransportBase. This class was a mixture of methods that did not use the class attributes and mostly accessors for attributes. After the refactoring most code is in static methods in JMSUtils which can all be understood independently.
Today I have worked on the next stage of the refactoring. The first thing I did was getting rid of the callback that happens after making the JMS connect in JMSProviderHub. I managed to refactor the code so that the connect method now simply returns the sessionFactory. I also completely restructured the JMSConduit. Both refactorings really help to understand the code as the flow is now much straighter.
Now we are ready to start thinking about how the code can use the Spring JMSTemplate and ListenerContainer. I guess when this is done a lot of lines of code in JMS Transport will not be necessary anymore. But this change will be difficult and I will have to dicuss several things with the CXF core developers before starting.
Comments (3)
Jun 11, 2009
Anonymous says:
Is there an example where a service behind MQ is described in WSDL (jms endpoint...Is there an example where a service behind MQ is described in WSDL (jms endpoint) and one can use something like WSDL2Java to access this service (like one with HTTP endpoint)?
Thanks!
Vishal
Jun 11, 2009
Christian Schneider says:
I think there is no example for MQ but many for ActiveMQ. You can also take a lo...I think there is no example for MQ but many for ActiveMQ. You can also take a look at the wsdls that are used in the unit tests for cxf. Just check out the source and search for wsdls.
Jan 18
Anonymous says:
Hi, Christian. Even if I’m a newbie at webservices I found your tutorial very us...Hi, Christian. Even if I’m a newbie at webservices I found your tutorial very useful, thanks. I want to say that I downloaded many helpful tutorials and articles on the matter therefore I can give you a piece of advice. First of all, you DO need the fully qualified class name of your service implementation in the cxf.xml Spring configuration file. You also, DO need the fully qualified class name of your service interface when specifying the endpoint interface in your service implementation. And, after all, you don’t need any annotations in your bean for CXF. It will work correctly with just a POJO (Plain Old Java Object). However, I don’t think CXF will like having only getters.
Add Comment