_connection = (AMQConnection) getConnection("guest", "guest");
_destination1 = new AMQQueue(_connection, "q1", true);
_destination2 = new AMQQueue(_connection, "q2", true);
_session1 = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
_session1.createConsumer(_destination1).setMessageListener(new MessageListener()
{
public void onMessage(Message message)
{
_log.debug("consumer 1 got message [" + getTextMessage(message) + "]");
synchronized (_received1)
{
_received1.add(message);
_received1.notify();
}
}
});
_session2 = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
_session2.createConsumer(_destination2).setMessageListener(new MessageListener()
{
public void onMessage(Message message)
{
_log.debug("consumer 2 got message [" + getTextMessage(message) + "]");
synchronized (_received2)