Blog from September, 2008

After having done several patches for the Apache CXF JMS componentI was voted as a commiter for the CXF project. Today I have got my user for the Apache subversion repository and of course I am eager to do my first own addition to the tree. I have already prepared a new stage in the JMS rewrite that is soon ready. It will complete the transition to Spring JmsTemplate and JmsMessageListener and also make the Conduit work asynchronously.

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.