// set up a TopicRequestor and send a request
TopicRequestor request = new TopicRequestor(session, topic);
for (int index = 0; index < 10; index++)
{
Message message = session.createTextMessage(
"Message to send " + index);
Message received_msg = request.request(message);
}
System.err.println("Processed 10 messages through the temporary topic");