4 Replies Latest reply on Feb 8, 2011 2:29 AM by Andy Taylor

    QueueDepth via JMX using jnp 1099?

    Hugh Bragg Newbie

      Is there a standard way to lookup the queuedepth and consumercount over jmx for standalone hornetq that's compatible with jbossmq?


      I'm asking because we have several hornetq instances running standalone and some old jbossmq instances whcih all need to be monitored as well as anotehr romote instance where there is no access to the management console.


      I've got a prototype runnng which uses service:jmx:rmi:///jndi/rmi:// with name ObjectNameBuilder.DEFAULT.getJMSQueueObjectName(queueName) for hornetq; and another which uses jnp: for jbossmq with the name "jboss.mq.destination:service=Queue,name="+queueName but what I'd like is a uniform way to connect to them both.


      I was hoping to use the jnp address to connect tp hornetq, but unless I'm mistaken the jmx MBeanInfo isn't available that way.

      I'm also aware that the structure of the MBeanInfo is different. Jbossmq uses QueueDepth,ReceiversCount and HornetQ uses MessageCount,ConsumerCount, but I think I can easily program around this.


      Is there a way to get the MBeanInfo for the hornetq using the jboss client libraries and the jnp address over the RMIAdaptor?

        • 1. QueueDepth via JMX using jnp 1099?
          Hugh Bragg Newbie

          I've tried connecting using the same method I'd use if hornet was running under jboss.

          I intended to use new ObjectName("org.hornetq:module=JMS,type=Queue,name="+queueName); instead of the jboss.mq.destination

          I get NameNotFoundException: jmx not bound using on ic.lookup("jmx/invoker/RMIAdaptor");


          So stand alone hornet doesn't have this invoker, no surprises there I guess.


          Does that mean HornetQ provides no standard way to use JMX via the jndi lookup?

          • 2. QueueDepth via JMX using jnp 1099?
            Andy Taylor Master

            Theres a management section in the user manual that explains all the management functionality that is exposed.

            • 3. Re: QueueDepth via JMX using jnp 1099?
              Hugh Bragg Newbie

              Thanks Andy,


              Since there is no JBoss in stand alone mode, I guess there is no way to use JMX via JNDI.

              The manual certainly doesn't explain how this would be done. Should I assume it's not possible?

              javax.naming.NameNotFoundException: jmx not bound


              I can't see that it would be a big problem since all the pieces are there. I guess there just needs to be a way to expose the jmx interface through the jndi lookup when there is no JBoss. I can't find the interface anywhere. If it is, could you point me to some description of how to implement this?

              • 4. Re: QueueDepth via JMX using jnp 1099?
                Andy Taylor Master

                not standalone, we have no control over this, in jboss we use the jboss mbean server which is available via jboss jndi, standalone we use the default jdk mbean server. You can still access it tho, just not via jndi.