5 Replies Latest reply on Apr 8, 2010 10:53 AM by Jeff Mesnil

    HornetQ 2.0.0 - embedded example - how to enable JMX via java API

    Serge Merzliakov Newbie

      Hi,

        I have successfully got the embedded hornetq server running in some java code. I do not know how to enable JMX (in Java API) for this embedded instance apart from setting JVM parameters at startup:

       

      -Dcom.sun.management.jmxremote

      -Dcom.sun.management.jmxremote.port=3000

      -Dcom.sun.management.jmxremote.ssl=false

      -Dcom.sun.management.jmxremote.authenticate=false

       

      Using the above parameters works. Can I enable JMX via code only ?

       

      I have tried:

       

      Configuration conf = new ConfigurationImpl();

      ...

      conf.setJMXManagementEnabled(true);

      ...

      server = new HornetQServers.newHornetQServer(conf);

      ...

       

      But this does not work - I expect that other parameters like JMX port need to be set. I also tried setting TransportConfiguration parameters with no luck either.

       

      Any suggestions ?

       

      Regards,

      Serge