This content has been marked as final. Show 1 reply
rupertlssmith wrote:i think you're on the right track with this. you definitely want a single registry running in a well known location. i'd run the registry on the webapp box, but in a separate process (this allows the webapp to be restarted without disrupting the registry). then, each remote box would register a connector in this registry, from which your webapp would locate the running instances. (note, you are not registering the mbeans with this registry, just an mbean connector for each remote mbean server).
I know that RMI can sometimes be problematic with respect to firewalls, because it assigns service ports dynamically, and firewall admins would like a fixed port number to open. I found this example, which explains one way of getting around this problem:
Another possibility seems to be to use JMXMP.
I don't think I really want the rmiregistry running on each server where an app instance resides. It seems to me that the 'registry', that is, the place where the JMX beans are looked up, should reside on the same machine where the JMX console webapp is running. Each app instance, when started will know the address of that machine, and attempt to register its MBeans with it (if it fails it can start anyway, and periodically retry exposing its management interface). Then the webapp just has one place to look to find all available apps.
i'd avoid the jmxmp connector since it is not directly supported in the jdk and because there does not seem to be any compelling reason to use it over rmi (as long as you specify the rmi ports utilizing the technique in the post you referenced). if you did use the jmxmp connector, you'd still have a discovery problem, which the rmi connector solves with the rmiregistry.