if (broker == null) {
throw new ConfigurationException(null, "Broker not defined");
}
// TODO deal with multiple brokers
SpringBrokerContext brokerContext = new SpringBrokerContext();
brokerContext.setConfigurationUrl(resource.getURL().toExternalForm());
brokerContext.setApplicationContext(ctx);
broker.setBrokerContext(brokerContext);
broker.start();
broker.waitUntilStarted();
brokers.put(pid, broker);