ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Simple question about topic creation

Post new topic  Reply to topic
 Simple question about topic creation « View previous topic :: View next topic » 
Author Message
skysurfer
PostPosted: Mon Jun 10, 2002 12:26 pm    Post subject: Simple question about topic creation Reply with quote

Newbie

Joined: 10 Jun 2002
Posts: 3

JMS specifies that topic generally should be got via JNDI lookup and programmatically only temporaryTopic be created. However, JMS also has createTopic(String str) method in the TopicSession class and states that implementation be provider-specific.

Question 1--> I want to know how MQseries handle this. Is that MQseries createTopic(String str) only creates a temporary topic that will go away after this connection is closed?

Question 2 --> If answer to question 1 is yes (temporary), then does MQseries provide programmatic creation of topic that persists?

Question 3 --> Any tools or utility exists to see what topics a broker currently has?

Here are some of the information I read from Jguru but I don't know how MQseries works
--------------------------------------------------------------------------
How does a client create a topic (or a queue)?
Location: http://www.jguru.com/faq/view.jsp?EID=1188
Created: Nov 21, 1999
Author: Jerry Smith (http://www.jguru.com/guru/viewbio.jsp?EID=9)

In the section "Topic Management" the JMS specification states: "JMS does not define facilities for creating, administering, or deleting topics." In the JMS API, however, the QueueSession and TopicSession interfaces include createQueue() and createTopic(), respectively.

For now, it's likely that JMS implementations will vary with respect to static versus dynamic topic creation, as well as external topic administration and manipulation. It's possible that some implementations will require static topic creation in advance using external functionality, for example, a utility. Some JMS implementations include a complete system administration tool for topic and queue management. Some implementations will provide administrative APIs for programmatic control of resource management. Other implementations may provide basic facilities for, say, topic or queue creation on the fly, plus an administrative console for creation, deletion, and other management tasks, plus security management.

For example, some environments support dynamic look-up using JNDI, plus dynamic destination creation, if necessary:

...
try {
queue = (Queue) c.lookup(QUEUE);
}
catch (NamingException ne) {
try {
queue = session.createQueue(QUEUE);
c.bind(QUEUE, queue);
}
catch (Exception e) {
readyToSend = false;
closeConnection();
return;
}
}
...
In the previous code segment, c is a JNDI InitialContext object.
Back to top
View user's profile Send private message
kolban
PostPosted: Mon Jun 10, 2002 4:22 pm    Post subject: Reply with quote

Grand Master

Joined: 22 May 2001
Posts: 1072
Location: Fort Worth, TX, USA

A JMS Topic is a reference to a Pub/Sub topic. This is the same concept as saying a JMS Queue is a reference to a Queue.

The Topic contains the information to locate and access the pub/sub topic. In IBM's implementation of JMS, you do not need to predefine topics. When a subscriber subscribes on a topic or a publisher publishes on a topic, the pub/sub topic is created.

While there are exitsing subscribers (either active or inactive durable), these can be viewed with the amqspsd program supplied with ma0c support pac. There is no meaning in JMS/MQ for finding a list of publishers.
Back to top
View user's profile Send private message
skysurfer
PostPosted: Tue Jun 11, 2002 5:39 am    Post subject: Reply with quote

Newbie

Joined: 10 Jun 2002
Posts: 3

Kolban, I understand that a topic can be created at run time/dynamically. My doubt is whether that topic can still persist after the connection which it is created from is closed.

If so, how can a subscriber created later, say in another piece of program, get hold of/identify the topic ? By JNDI or by unique name or ...?

Hope to hear more details from you. Better some sample code....
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Simple question about topic creation
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.