@Test
public void testProduce() throws Exception {
Stomp stomp = new Stomp("tcp://localhost:" + getPort());
final BlockingConnection subscribeConnection = stomp.connectBlocking();
StompFrame frame = new StompFrame(SUBSCRIBE);
frame.addHeader(DESTINATION, StompFrame.encodeHeader("/queue/test"));
frame.addHeader(ID, subscribeConnection.nextId());
StompFrame response = subscribeConnection.request(frame);
final CountDownLatch latch = new CountDownLatch(numberOfMessages);
Thread thread = new Thread(new Runnable() {
public void run() {
for (int i = 0; i < numberOfMessages; i++) {
try {
StompFrame frame = subscribeConnection.receive();
latch.countDown();
} catch (Exception e) {
e.printStackTrace();
break;
}