title: Monitoring the activemq queue with Jolokia
body: <p>Using the activemq jms for queue mechanism, I would like to monitor my queue for example the size of the queue. And i am using Jolokia as the bridge to perform rest requests on JMX. </p>
  
  <p>Queue is configured in the wildfly and works fine:</p>
  
  <pre><code>&lt;subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0"&gt;
          &lt;server name="default"&gt;
              &lt;http-connector name="http-connector" socket-binding="http" endpoint="http-acceptor"/&gt;
                  ...
              &lt;/http-connector&gt;
              &lt;http-acceptor name="http-acceptor" http-listener="default"/&gt;
                  ...
              &lt;/http-acceptor&gt;
              &lt;jms-queue name="QueueName" entries="java:/jms/queue/QueueName"/&gt;
              &lt;pooled-connection-factory name="activemq-ra" entries="java:/JmsXA java:jboss/DefaultJMSConnectionFactory" connectors="in-vm" transaction="xa"/&gt;
          &lt;/server&gt;
  &lt;/subsystem&gt;
  </code></pre>
  
  <p>I have deployed Jolokia war file on wildfly under deployments and the following url brings me a list of attributes:</p>
  
  <pre><code>   localhost:8080/jolokia/list 
  </code></pre>
  
  <p>Now i would like to read information about my queue, so i use the following rest request:</p>
  
  <pre><code>   localhost:8080/jolokia/read/org.apache.activemq.artemis:module=JMS,type=Queue,name=*QueueName*
  </code></pre>
  
  <p>However, this throws back the following exception:</p>
  
  <pre><code>  "stacktrace": "javax.management.InstanceNotFoundException: No MBean with pattern org.apache.activemq.artemis:module=JMS,type=Queue,name=*QueueName* found for reading attributes\n\tat org.jolokia.handler.ReadHandler.searchMBeans(ReadHandler.java:160)\n\tat org.jolokia.handler.ReadHandler.fetchAttributesForMBeanPattern(ReadHandler.java:126)\n\tat org.jolokia.handler.ReadHandler.doHandleRequest(ReadHandler.java:116)\n\tat org.jolokia.handler.ReadHandler.doHandleRequest(ReadHandler.java:37)\n\tat org.jolokia.handler.JsonRequestHandler.handleRequest(JsonRequestHandler.java:161)\n\tat org.jolokia.backend.MBeanServerHandler
  </code></pre>
  
  <p>I have tried to enable the jmx in standalone by adding the jmx subsystem as following:</p>
  
  <pre><code>&lt;subsystem xmlns="urn:jboss:domain:jmx:1.3"&gt;
          &lt;remoting-connector use-management-endpoint="false"/&gt;
  &lt;/subsystem&gt;
  
  
   &lt;connector socket-binding="jmx-remote" name="jmx-remote-connector" security-    realm="ApplicationRealm"/&gt;
  
  
   &lt;socket-binding name="jmx-remote" port="${jboss.jmx.port:7909}" fixed-port="false"/&gt;
  </code></pre>
  
  <p>But it still does not work. Any help regarding the corrections for my approach or an alternative approach would be appreciated.</p>