File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Spring and the fly likes spring roo and activemq Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "spring roo and activemq" Watch "spring roo and activemq" New topic

spring roo and activemq

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

I dont understand the connection between roo and active mq. what benefits does it provide?


Ken Rimple
Ranch Hand

Joined: Jul 20, 2010
Posts: 63

The ActiveMQ connection is just a sample of a JMS configuration. When you do

roo> jms setup

Roo builds an ActiveMQ embedded container, and binds it to a connection factory for use by Spring JMS APIs.

Here it is from the applicationContext-jms.xml file:

It also creates a JMS Template (which you could inject anywhere in a service and then use to send messages or receive them synchronously:

If you want to deliver messages to specific beans, Roo can do that too. You can issue this command:

roo> jms listener class --class ~.baz.ListenerGuy --destination myQueue --destinationType QUEUE

and you'll get a queue listener, which allows Spring to deliver JMS messages to a POJO:

The listener is not a message driven EJB, it's just a Spring bean with a specific method:

Why ActiveMQ? Because it was available and open for anyone to set up.

If you want to use your own JMS setup, you can, just replace the amq: tags above with a <jee:jndi> tag to look up the Connection Factory, then inject it into cachingConnectionFactory, for example.

Unfortunately there is only one provider in the base roo configuration, ACTIVEMQ_IN_MEMORY. It would be nice to expand that list. (Patch suggestion...)


Ken Rimple
Co-author, Manning Spring Roo in Action
I teach for Chariot Solutions (Spring, Maven, Hibernate, other courses). Schedule here
Srini Penchikala

Joined: May 01, 2012
Posts: 5
I just want to add to Ken's response. ActiveMQ is becoming a popular JMS container in the open source messaging framework category. It's easy to unit test with, because of its support for embedded broker. It also has fine grained security control at different levels of JMS architecture (i.e. Broker, Connection and Message level). If you are interested in learning more about ActiveMQ, checkout their website or ActiveMQ in Action book from the same publishers as our book (Manning).

I agree. Here's the link:
subject: spring roo and activemq
It's not a secret anymore!