_producer.setDisableMessageTimestamp(true);
_producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
_tempDestination = new AMQQueue("TempResponse" +
Long.toString(System.currentTimeMillis()), true);
MessageConsumer messageConsumer = (MessageConsumer) _session.createConsumer(_tempDestination, 100, true,
true, null);
//Send first message, then wait a bit to allow the provider to get initialised
TextMessage first = _session.createTextMessage(MESSAGE_DATA);
first.setJMSReplyTo(_tempDestination);
_producer.send(first);
try
{
Thread.sleep(1000);
}
catch (InterruptedException ignore)
{
}
//now start the clock and the test...
final long startTime = System.currentTimeMillis();
messageConsumer.setMessageListener(new CallbackHandler(messageCount, startTime));
}
catch (JMSException e)
{
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}