return session.createConsumer(destination);
}
protected ActiveMQConnectionFactory createGenericClusterFactory(String brokerName) throws JMSException {
BrokerContainer container = new BrokerContainerImpl(brokerName);
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();