File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
Author

spring roo and activemq

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

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

source http://www.manning.com/rimple/


Groovy
Ken Rimple
author
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

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

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).

Thanks
Srini
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: spring roo and activemq