Java – JMX port dynamic allocation

I have 16 Java processes running the same main methods and parameters on one machine I want to monitor these remotely through jconsole

Like - DCOM sun. management. jmxremote. Hard coded port numbers such as port = 5000 will not work because these processes use the same configuration and cannot use the same port

Can the JVM dynamically select different ports for each of the 16 processes?

Solution

Using RMI connector may be like specifying the URL of the proxy

If you need it, you can programmatically create the RMI registry using the following command:

java.rmi.registry.LocateRegistry.createRegistry(port);

You may find the following unrelated examples useful: connecting through firewall using JMX

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>