// now lets receive it
MessageConsumer consumer1 = session.createConsumer(queue);
MessageConsumer consumer2 = session.createConsumer(queue);
TextMessage answer = (TextMessage)consumer1.receiveNoWait();
assertEquals("Should have received a message!", answer.getText(), "Msg1");
answer = (TextMessage)consumer2.receiveNoWait();
assertEquals("Should have received a message!", answer.getText(), "Msg2");
answer = (TextMessage)consumer2.receiveNoWait();
assertNull("Should have not received a message!", answer);
}