summary refs log tree commit diff
path: root/nixos/modules/services/amqp/activemq/ActiveMQBroker.java
blob: c0f5d16ea11ab64a0aaa870daf6718f297cb1a5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import org.apache.activemq.broker.BrokerService;
import org.apache.activemq.broker.BrokerFactory;
import java.net.URI;

public class ActiveMQBroker {

  public static void main(String[] args) throws Throwable {
    URI uri = new URI((args.length > 0) ? args[0] : "xbean:activemq.xml");
    BrokerService broker = BrokerFactory.createBroker(uri);
    broker.start();
    if (broker.waitUntilStarted()) {
      broker.waitUntilStopped();
    } else {
      System.out.println("Failed starting broker");
      System.exit(-1);
    };
  }

}