BrokerService brokerService1 = null;
BrokerService brokerService2 = null;
ActiveMQConnectionFactory acf1 = null;
ActiveMQConnectionFactory acf2 = null;
PooledConnectionFactory pcf = null;
DefaultMessageListenerContainer container1 = null;
try {
brokerService1 = createBrokerService("broker1", URL1, URL2);
brokerService1.start();
brokerService2 = createBrokerService("broker2", URL2, URL1);
brokerService2.start();
acf1 = createConnectionFactory(URL1);
acf2 = createConnectionFactory(URL2);
pcf = new PooledConnectionFactory(acf1);
Thread.sleep(1000);
doneLatch = new CountDownLatch(MAX_PRODUCERS * NUM_MESSAGE_TO_SEND);
container1 = createDefaultMessageListenerContainer(acf2, new TestMessageListener1(500), QUEUE1_NAME);