You could use this method:
HornetQServers.newHornetQServer(conf,java.lang.management.ManagementFactory.getPlatformMBeanServer(), false | true);
Thanks for the tip. It is seems a step closer, but unfortunately JMX connection requests are still being refused. I am investigating on how to set or get configuration details out of JMX interface to see if I can poinpoint the issue.
This is more a question of how to get the JMX server that is built into Java working, rather than a HornetQ specific question.
I'd take a look at the JMX tutorial on the Sun Java site.
Also look at the JMX example that is part of hornetq.
On a distribution, go to /examples/jms/jmx
1 of 1 people found this helpful
Serge Merzliakov wrote:
Configuration conf = new ConfigurationImpl();
This settings specifies that HornetQ resources will be manageable through JMX (i.e. registed in the MBeanServer).
However, it does not imply how JMX clients will connect to the MBeanServer.
afaik, you need to specifiy the JVM parameters on startup. I don't know of a simple way to do that from code.
It should be possible (e.g. somehow create an instance of the JMX RMI connnector, bind it to the platform MBeanServer) but this is out of scope of HornetQ. You'll find more info on JMX web site to get you started: http://java.sun.com/javase/technologies/core/mntr-mgmt/javamanagement/