May 15th, 2007, 01:59 AM
JMS MDP connectionfactory question
I'm trying to use JMS in Spring.
Is it true that next to Spring I need a JMS container part of a J2EE application server or a standalone product like Apache MQ?
My first impression was that one of Spring's xListnerContainer would act as JMS container.
But as I read the documentation I see you still need to assign a ConnectionFactory to those listeners. What should I use here?
May 15th, 2007, 02:35 AM
To use JMS at all, you need a JMS provider, either from app server or standalone. This provides the message broker that actually handles the send ing of the messages for you (you will notice that JMS API is all interfaces, it has to be implemented by the provider). We are currently using ActiveMQ as standalone with Spring and found it very easy to get going, its actually does run right outta the box!
When using Spring and JMS, you first start the broker at a URL.
You then create a connection factory bean specifying the broker URL and then pass that factory to the JmsTemplate class from Spring. This is a helper class that you actually use to send the messages, its easy to use once you have the setup conplete.