Posted By:
Nick_Maiorano
Posted On:
Saturday, March 15, 2003 07:29 AM
Binoj,
You can easily create topics or queue dynamically. The code looks something like this:
//jndi lookup for the TopicConnectionFactory
TopicConnectionFactory tcf = context.lookup("your configured connection factory name");
TopicConnection tc = tcf.createTopicConnection();
TopicSession ts = tc.createTopicSession(true, Session.AUTO_ACKNOWLEDGE);
TemporaryTopic tt = ts.createTemporaryTopics();
TopicPublisher tp = ts.createPublisher(tt);
tp.publish(...);
You can create multiple topics at the same time too. You just need to create a connection for each topic.
For more info, click here.