configurator.setProperties(props);
configurator.setIgnoreUnresolvablePlaceholders(true);
ctx.addBeanFactoryPostProcessor(configurator);
ctx.refresh();
// Start the broker
BrokerService broker = ctx.getBean(BrokerService.class);
if (broker == null) {
throw new ConfigurationException(null, "Broker not defined");