Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3401692
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T05:02:48+00:00 2026-05-18T05:02:48+00:00

My question is pretty simple, but I am having a bad time finding a

  • 0

My question is pretty simple, but I am having a bad time finding a solution.
I want to be able to get all the queues in the server (or session, that would also be ok). Is that possible?

My situation is the following:
I am new to openMQ, Glassfish, activeMQ and so on. I developed a monitoring system for activeMQ in which I get all the existing queues and show to the user, so it can get information about number of messages and so on.
To do that, I have this code:

ActiveMQConnection.makeConnection("tcp://localhost:61616");
activeMQConnection.start();

//Get queues
DestinationSource destinationSource = activeMQConnection.getDestinationSource();
Set<ActiveMQQueue> queues = destinationSource.getQueues();

this last line gets all the queues for the connection, and this is exactly what I need. But this was my code for ActiveMQ.

Now the team decided to change to openMQ, and I have to adapt my monitoring system to be able to handle that. I would like to use LDAP so I can do it technology-independent. After a lot of research I came to this code:

ConnectionFactory connectionFactory = (ConnectionFactory) ctx.lookup("cn=QueueConnectionFactory");

Connection connection = connectionFactory.createConnection();
Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);

Queue myQueue = session.createQueue(“myQueue”);

This is good, because it would be completely independente (I think, have to test it). But the problem is that I have to register the queue, something I would not like to do. I would like to get all the existing queues in the server without any need for registering, but I can’t find any GetQueues() method or any way to mimic its behavior.

I also found out the the DestinationSource class in activeMQ inherits from MessageListener, but this class doesn’t provides any similar method 🙁

Could you please help me?

thank you,
Oscar

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T05:02:49+00:00Added an answer on May 18, 2026 at 5:02 am

    I was able to do that using JMX, here is the code:

    HashMap environment = new HashMap();
      String[] credentials = new String[] { "user", "pass" };
      environment.put(JMXConnector.CREDENTIALS, credentials);
    
      JMXServiceURL url = new JMXServiceURL("URL");
    
      // Get JMX connector, supplying user name and password
      JMXConnector jmxc1 = JMXConnectorFactory.connect(url, environment);
    
      // Get MBean server connection
      MBeanServerConnection mbsc = jmxc1.getMBeanServerConnection();
    
      ObjectName destMgrConfigName = new ObjectName(MQObjectName.DESTINATION_MANAGER_MONITOR_MBEAN_NAME);
    
      // Create operation's parameter and signature arrays
    
      Object opParams[] = {};
    
      String opSig[] = {};
    
      // Invoke operation
      ObjectName[] objectNames = (ObjectName[]) mbsc.invoke(destMgrConfigName, DestinationOperations.GET_DESTINATIONS, opParams, opSig);
    
      for (ObjectName objectName : objectNames) {
       System.out.println(objectName.getCanonicalName());
       System.out.println(objectName.getKeyProperty("name"));
      }
    

    more references here: http://forums.oracle.com/forums/thread.jspa?threadID=2129291&tstart=0

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I think this is a pretty simple question but I'm having trouble finding the
This question is pretty generic actually, but I'm really having trouble finding a good
I'm pretty sure this is a simple question in regards to formatting but here's
Question is pretty self explanitory. I want to do a simple find and replace,
This seems like a pretty softball question, but I always have a hard time
I have a pretty simple question which perhaps someone familiar with Server/Client design &
Pretty simple question: When i have a persistable object, it usually has a property
Pretty simple question, I'm writing an XML document and i'm not sure how to
My question is pretty vague :o) - But here is an example : When
This is a pretty simple question, at least it seems like it should be,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.