2

I've been doing some research(here and here and etc.) and with some experience I have follwing feeling about the choice between the two, it seems like:

CachingConnectionFactory is for simple container that don't have much of messaging transaction management(like Tomcat with ActiveMQ), so that the caching part can guarantee some level of performance even if Spring by nature have to start a new session/connection/producer to each transmission, so the same connection/session get cached to reuse and avoid overhead by extending SingleConnectionFactory.

DelegatingConnectionFactory is for mature application server so that the CF/transaction management is in the hand of the server(Websphere MQ, JBoss HornetQ etc) so that this CF plays as a delegation and leaves the workload to the server. So the actual performance depends on how to tune up app server's CF and queue and transaction management.

I may be too drunk to make this up so please correct me if above does not make sense. I have one more question base on this comparison that, if Spring JmsTemplate by nature have to open/close session and all to each transmission, then how we can improve the performance by utilize the JmsTemplate with the app server's jms management?

Community
  • 1
  • 1
Dreamer
  • 7,333
  • 24
  • 99
  • 179

0 Answers0