Uploaded image for project: 'ActiveMQ Classic'
  1. ActiveMQ Classic
  2. AMQ-8371

DestinationSource.getQueues() does not enumerate existing queues

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 5.15.12
    • None
    • JMS client
    • None

    Description

      I desire to programatically purge all queues, either as an administrative function or during dev/test to get a clean system.

      Following inline examples, I've written code like;

       

      ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url);
      ActiveMQConnection connection = (ActiveMQConnection)connectionFactory.createConnection();
      DestinationSource destinationSource = connection.getDestinationSource();
      for (ActiveMQQueue queue : destinationSource.getQueues()) {
          connection.destroyDestination(queue);
      }

      However, getQueues() always returns an empty set, even though there are queues visible in the web console.  Looking at the source code, it appears that the queues list is only populated by listening for queue-create advisory topic messages, so any queues that exist at the time this code is run are not listed.

      This would seem to contradict the docs where it says "As of 5.1.0 you can use the new DestinationSource on an ActiveMQConnection to access the available queues"

      Attachments

        Activity

          People

            Unassigned Unassigned
            john.lilley@redpoint.net john lilley
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: