views:

66

answers:

3

Is there a way to run ActiveMq offline?

A: 

Yes, you can do something like "running offline" by embedding broker into JVM. This is usually done for (unit) testing.

BrokerService broker = new BrokerService();
// configure the broker
broker.addConnector("tcp://localhost:61616");
broker.start();
koppernickus
+1  A: 

It depends on what you mean by offline.

You can start a broker inside of a Java application simply by creating a ConnectionFactory like so:

ActiveMQConnectionFactory cf = new ActiveMQConnectionFactory("vm://localhost?broker.persistent=false");

This broker would only be accessible from within the Java application where it was created using the vm://localhost transport.

Bruce

bsnyder
A: 

Sorry, I think it was a little vague, I explained better in:

http://stackoverflow.com/questions/2560467/how-to-associate-the-activemq-core-xsd-url-with-the-activemq-xsd-found-in-the-jar

Thanks for help

livia