This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I am trying to manage multiple Java processes on serverside with JMX. I have AcitveMQ setup and I can specify in the activemq.xml config file:
<managementContext connectorPort="10120" rmiServerPort="10135" jmxDomainName="my-broker" connectorPath="/jmxrmione" />
so the registry ist startet at port 10120 and the serviceport is 10135. the "stub" ist exportet with the name jmxrmione. I can connect tot it with JConsole using:
How can I specify the Name of the "Stub" for a Java-Process ? Default seems always to be rmijmx.
How can I set the ServicePort for JMX for that Java-Process ? The Registryport can be set with the property com.sun.management.jmxremote=xxxx.
I could live with if I have to use a different registry for every JVM just for the sake of JMX, (although it seems very strange since I would use different names for the exportet stub) but the arbirtary Port is really a pain.
If rmiregistry is running on port 10120, then from each of your java server processes, create a connector server factory with different service URLs as shown below:
Configure ActiveMQ to use the same RMI registry port:
ActiveMQ can then be monitored at service:jmx:rmi:///jndi/rmi://localhost:10120/jmxactivemq.
The rmiServerPort is ActiveMQ JMX agent's preferred ServerSocket port. Unless you have firewall restrictions, it need not be specified - it'll use any free port.
Joined: Mar 22, 2006
Thank you very much for your reply !!
It works exactly the way I needed to have it ! Since you mentioned the Firewall-Issue:
As said, to preset the "ServicePort" for ActiveMQ: