title: Get JMS Queue ObjectName on Wildfly
body: <p>I want to get number of objects in Queue. This is the code I found:</p>
  
  <pre><code>MBeanServerConnection mbeanServer = ManagementFactory.getPlatformMBeanServer();
  ObjectName queueName = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queue.getQueueName());
  Integer messageCount = (Integer) mbeanServer.getAttribute(queueName, "MessageCount");
  </code></pre>
  
  <p>There's some problem with this code. First of all there's no <code>ObjectNameBuilder</code> class on wildfly (Is there any module required!?).</p>
  
  <p>After using HornetQ ObjectNameBuilder class source code, I've implemented the function by myself, but now getting this error:</p>
  
  <pre><code>org.hornetq:module=JMS,type=Queue,name="MyQueueName"
  </code></pre>
  
  <p>I'm using <code>Wildfly v9.0.1-Final</code>. Any suggestion?</p>