//ActiveMQConnectionFactory consumerFactory = new ActiveMQConnectionFactory("tcp://localhost:51618?wireFormat.cacheEnabled=false");
ActiveMQConnectionFactory consumerFactory = new ActiveMQConnectionFactory("tcp://localhost:51618");
Connection consumerConnection = consumerFactory.createConnection();
consumerConnection.start();
Session consumerSession = consumerConnection.createSession(false, Session.AUTO_ACKNOWLEDGE);
ConsumerThread consumer = new ConsumerThread(consumerSession, consumerSession.createQueue("ProxyTest"));
consumer.start();
Thread.sleep(10*1000);
remoteBroker.stop();
remoteBroker.waitUntilStopped();
startRemoteBroker(false);
producer.join();
consumer.join();
assertEquals(1000, consumer.getReceived());
}