{
Topic topic = (Topic)context.lookup(TEST_TOPIC);
TopicSession session = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
Message message = session.createTextMessage();
QueueSession qsession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
TemporaryQueue temp = qsession.createTemporaryQueue();
message.setJMSReplyTo(temp);
TopicPublisher publisher = session.createPublisher(topic);
publisher.publish(message);
QueueReceiver receiver = qsession.createReceiver(temp);
if (receiver.receive(2000) == null)
{
state.addError(new Exception("Didn't receive message"));
}
receiver.close();