Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Both aspects are critical for enterprise applications and their implementation is not an easy task. Is there any solution? Yes: Spring JMS functionality and CXF Features. Let discuss them in detail.

(star) - Some JMS vendors provide integrated session pooling in ConnectionFactory. In this case using CachingConnectionFactory is not necessary. Please refer vendor documentation to clear it.

Spring JMS functionality

Spring provides a number of useful classes that helps to implement scalable JMS application. Important for us are: org.springframework.jms.connection.CachingConnectionFactory
org.springframework.jms.listener.DefaultMessageListenerContainer

...

It is possible to define here:

  1. initial Initial and maximal number of concurrent consumers. This tells the Spring to always start up a initial number of consumers (concurrentConsumers). When a new message has been received, if the maxConcurrentConsumers has not been reached, then a new consumer is created to process the message.
  2. cache Cache level (3- cache connection, session and consumers; 2 – cache connection and session, 1 – cache connection only)
  3. specify Specify message listener class (implementing MessageListener interface) and connection factory.

It is important to be aware of following things related to consumers caching: a)

  • it doesn't make sense to increase the number of concurrent consumers for a JMS topic. This just leads to concurrent consumption of the same message.

...

You can see that Spring provides solution for both mentioned scalability aspects. But how we can use it in CXF?

...

  1. CXF JMS Transport: http://cxf.apache.org/docs/jms-transport.html
  2. CXF Features: http://cxf.apache.org/docs/features.html
  3. Spring JMS functionality: http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/jms.html
  4. Spring JMS performance tunning: http://bsnyderblog.blogspot.com/2010/05/tuning-jms-message-consumption-in.html
  5. CXF performance: http://www.liquid-reality.de/pages/viewpage.action?pageId=5865562

...