ZeroconfDiscoveryAgent agent = new ZeroconfDiscoveryAgent();
agent.setType(getClass().getName() + ".");
container.setDiscoveryAgent(agent);
String url = "tcp://localhost:0";
container.addConnector(url);
container.addNetworkConnector(new DiscoveryNetworkConnector(container));
container.start();
//embedded brokers are resolved by url - so make url unique
//this confused me tests for a while :-)
return new ActiveMQConnectionFactory(container,"vm://"+brokerName);
}