dcsimg
Dynamically creating multiple topics
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   binoj_v
Posted On:   Wednesday, March 12, 2003 12:48 AM








How to create topics Dynamically on client (producer) request on a JMS Server? Also is it possible to create multiple topics at same time?




Re: Dynamically creating multiple topics

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.

About | Sitemap | Contact