Thread.sleep(1000);
}
public void testClientDispatchAndReceiveOnReplyTo() throws Exception
{
MuleClient client = new MuleClient(muleContext);
Map props = new HashMap();
props.put(JmsConstants.JMS_REPLY_TO, "replyTo.queue");
long start = System.currentTimeMillis();
int i = 0;
for (i = 0; i < INTERATIONS; i++)
{
logger.debug("Sending message " + i);
client.dispatch(getDispatchUrl(), "Test Client Dispatch message " + i, props);
}
long time = System.currentTimeMillis() - start;
logger.debug("It took " + time + " ms to send " + i + " messages");
Thread.sleep(5000);
start = System.currentTimeMillis();
for (i = 0; i < INTERATIONS; i++)
{
MuleMessage message = client.request("jms://replyTo.queue", 5000);
assertNotNull("message should not be null from Reply queue", message);
logger.debug("Count is " + i);
logger.debug("ReplyTo Message is: " + message.getPayloadAsString());
assertTrue(message.getPayloadAsString().startsWith("Received"));
}