Is it possible to implement JMS messaging in tomcat? I have a spring mvc application and I need to implement JMS messaging.
I can not use glassfish. I know its very easy to do JMS messaging with message driven bean but on application server.
So if there is a possibility, can someone provide some examples how to create a JMS connection factory and queue for spring application?
I have a JMS queue sender class:
public class JmsQueueSender {
private JmsTemplate jmsTemplate;
private Queue queue;
public void setConnectionFactory(ConnectionFactory cf) { //?????????????????????
this.jmsTemplate = new JmsTemplate(cf);
}
public void setQueue(Queue queue) { //?????????????????????
this.queue = queue;
}
public void sendMessage(final Serializable object) {
jmsTemplate.send(this.queue, new MessageCreator() {
public Message createMessage(Session session) throws JMSException {
return session.createObjectMessage(object);
}
});
}
}
The main question is how to create a connection factory and queue, what objects to use. In glassfish I have been creating a JMS resource through application server admin console. How can I do this in spring application which runs in tomcat?