// message at the end of the onMessage method, after a close has been sent.
session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
ThreadTestCoordinator tt = new ThreadTestCoordinator(2);
tt.addTestThread(testThread1, 0);
tt.addTestThread(testThread2, 1);
tt.setDeadlockTimeout(500);
tt.run();
String errorMessage = tt.joinAndRetrieveMessages();