1

Is there a way to run ActiveMq offline?

Michael Myers
  • 188,989
  • 46
  • 291
  • 292
livia
  • 41
  • 3

2 Answers2

1

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
  • 1,199
  • 7
  • 7
0

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();
kopper
  • 2,676
  • 1
  • 16
  • 17