{"id":6691,"date":"2018-05-14T15:53:02","date_gmt":"2018-05-14T20:53:02","guid":{"rendered":"http:\/\/appcrawler.com\/wordpress\/?p=6691"},"modified":"2018-05-14T15:53:02","modified_gmt":"2018-05-14T20:53:02","slug":"listing-all-queues-in-activemq","status":"publish","type":"post","link":"http:\/\/appcrawler.com\/wordpress\/2018\/05\/14\/listing-all-queues-in-activemq\/","title":{"rendered":"Listing all queues in ActiveMQ"},"content":{"rendered":"<p>This still has an issue with getting a consistent read.  I will update this once I figure that piece out&#8230;<\/p>\n<pre>\r\nimport org.apache.activemq.*;\r\nimport java.util.*;\r\nimport org.apache.activemq.advisory.DestinationSource;\r\n\r\nimport javax.jms.*;\r\nimport javax.naming.*;\r\n\r\nimport org.apache.activemq.*;\r\nimport org.apache.activemq.command.ActiveMQQueue;\r\n\r\npublic class ListQueues {\r\n  public static void main(String[] args) throws  Exception {\r\n    String user = \"admin\";\r\n    String password = \"***********\";\r\n    String url = \"failover:(tcp:\/\/cmhlpromsesb02:61616,tcp:\/\/cmhlpromsesb01:61616)\";\r\n    ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(user,password,url);\r\n    ActiveMQConnection conn = (ActiveMQConnection)connectionFactory.createConnection();\r\n    conn.start();\r\n\r\n    DestinationSource destSource = conn.getDestinationSource();\r\n    Set<ActiveMQQueue> queues = destSource.getQueues();\r\n    System.out.println(\"Found '\" + queues.size() + \"' queues\");\r\n\r\n    for(ActiveMQQueue queue : queues) {\r\n      System.out.println(queue.getPhysicalName());\r\n    }\r\n    conn.close();\r\n  }\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This still has an issue with getting a consistent read. I will update this once I figure that piece out&#8230; import org.apache.activemq.*; import java.util.*; import org.apache.activemq.advisory.DestinationSource; import javax.jms.*; import javax.naming.*; import org.apache.activemq.*; import org.apache.activemq.command.ActiveMQQueue; public class ListQueues { public static&hellip;<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"http:\/\/appcrawler.com\/wordpress\/2018\/05\/14\/listing-all-queues-in-activemq\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_mi_skip_tracking":false,"footnotes":""},"categories":[71,69,7],"tags":[],"_links":{"self":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/6691"}],"collection":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/comments?post=6691"}],"version-history":[{"count":3,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/6691\/revisions"}],"predecessor-version":[{"id":6695,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/posts\/6691\/revisions\/6695"}],"wp:attachment":[{"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/media?parent=6691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/categories?post=6691"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/appcrawler.com\/wordpress\/wp-json\/wp\/v2\/tags?post=6691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}