Stalwart
Stalwart

Reputation: 59

How to start ActiveMQ from applicationContext.xml

I am running a Spring project which has an applicationContext.xml which contains Camel routes that puts a message onto an ActiveMQ queue that was manually created. Before running the project, I am manually starting the ActiveMQ server by logging into the folder activeMQ/bin and issuing the command activeMQ.

I would like to start ActiveMQ server from the applicationContext.xml . Can someone advice on how to do that?

Upvotes: 0

Views: 952

Answers (2)

Hussain Pirosha
Hussain Pirosha

Reputation: 1376

ActiveMQ provides support to start its broker in spring. Use the spring-activemq namespace to configure a broker inside spring's application context for details check spring support for activemq (http://activemq.apache.org/spring-support.html)

Upvotes: 0

Daniel
Daniel

Reputation: 2500

Not sure if this helps you or not, but I've done it the other way around. When starting my activemq instance, it also starts my camel routes.

If this is a viable solution in your case, follow these steps

  1. Copy the jar file with your camel project as well as any third party libs to [activemq_home]/lib
  2. At the bottom of [activemq_home]/conf/activemq.xml (assuming you are using the default config), add e.g.
  3. Now start/restart activemq, and it should start your camel routes defined in the application context.

Upvotes: 0

Related Questions