2 Replies Latest reply on Oct 23, 2012 8:08 AM by Jeff Mesnil

    How to programatically access a queue in JBoss 7.x

    Viggo Navarsete Expert



      in JBoss 6.1.0.Final we accessed a queue in JBoss (to get size, stop and start queue) by the following code:




      private JMSQueueControl getJMSQueueControl() throws Exception {
      MBeanServer server = MBeanServerFactory.findMBeanServer(null).get( 0 );
      bjectName on = ObjectNameBuilder.DEFAULT.getJMSQueueObjectName( queue.getQueueName() );
      eturn MBeanServerInvocationHandler
            .newProxyInstance(server, on, JMSQueueControl.class, false);


      According to clebert at the #hornetq irc chat JBoss 7.x is completely rewritten and it is done in another way. I would like an example how I can access a queue in JBoss 7.x and get queue size, start and stop a queue.


      I also add the chat from the #hornetq irc chat to give som context:

      (06:14:50 PM) clebert: vnvarsete: JBoss had its own JMX server

      (06:14:56 PM) clebert: vnvarsete: AS7 is a different thing...

      (06:15:05 PM) clebert: it doesn't have JMX as its heart beat

      (06:16:58 PM) clebert: vnvarsete: all the examples we have were for HornetQ on AS5

      (06:17:08 PM) clebert: vnvarsete: we probably need to recoup those

      (06:17:17 PM) Viggo: clebert: ok, so that's why perhaps Andy know most about it?!

      (06:17:37 PM) clebert: vnvarsete: Andy will know other ways to manage AS7

      (06:17:44 PM) clebert: vnvarsete: there are new ways now