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 » How do I list all topics + their real queue names?

Post new topic  Reply to topic
 How do I list all topics + their real queue names? « View previous topic :: View next topic » 
Author Message
wen
PostPosted: Thu Feb 13, 2003 7:07 am    Post subject: How do I list all topics + their real queue names? Reply with quote

Newbie

Joined: 09 Sep 2002
Posts: 3
Location: London

In our system we would like to monitor the topic queues but in MQ they have very user-unfriendly names such as "SYSTEM.JMS.D.2003012007222574" etc etc. I would therefore like to list the topic names plus the actual queue name.

Using the MQ JMS jars we have found a way to list all the topics and their corresponding queue names for our queue manager as follows:

Code:
try {
  MQEnvironment.hostname = hostname;
  MQEnvironment.channel = channel;
  MQEnvironment.port = port;
  MQQueueManager qMgr = new MQQueueManager(queueManager);
  MQDurSubAdmin durSubAdmin = new MQDurSubAdmin(qMgr);
  Vector vec = durSubAdmin.getAll();
  Iterator iter = vec.iterator();

  while(iter.hasNext()) {
    MQDurSubEntry entry = (MQDurSubEntry)iter.next();
    MQQueue q = new MQQueue(qMgr,entry.getQName(), MQC.MQOO_INQUIRE, null ,null, null);
    int qDepth =  q.getCurrentDepth();
    if(q!=null) q.close();
   
    String s = entry.getName().substring(entry.getName().indexOf(":")+1);
    String topicName = s;
    String qName = entry.getQName();
    }      
  } catch (Exception e) {
    System.out.println(e.getMessage());   
}


This works fine most of the time, except I occasionally get the error 2042 - MQRC_OBJECT_IN_USE. According to the Application Programming Reference manual it could be because another application has opened the object. This is true in the there are other processes which are simultaneously subscribing to these topics and processing the messages as they arrive.

Is there a better solution than this i.e. somehow through the TopicConnectionFactory?
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 » How do I list all topics + their real queue names?
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.