throws Exception
{
/* Create Naming-Context */
Context ctx = new InitialContext(namingProps);
/* Lookup 'administerable' Objects */
TopicConnectionFactory tcf = (TopicConnectionFactory)ctx.lookup("TopicConnectionFactory");
Topic t = (Topic)ctx.lookup("testTopic");
TopicConnection tc = null;
TopicSession s_send = null;
TopicSession s_rec1 = null;
TopicSession s_rec2 = null;
try {
final long start = System.currentTimeMillis();
final String type = Long.toString(start);
/* Create a connection to the topic */
tc = tcf.createTopicConnection("system", "system");
/* Create a session on top of the connection which will be used only for
sending messages, transacted and with auto-acknowledge-mode*/
s_send = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
/* Create sessions on top of the connection which will be used only for
receiving messages, transacted and with auto-acknowledge-mode */