我想使用 MBean 监视在远程计算机上运行的 Spring 集成服务器。 我将以下内容添加到 spring 上下文文件中。
<context:mbean-server />
<int-jmx:mbean-export id="integrationMBeanExporter" default-domain="spring.application" />
这应该允许使用 VisualVM 查看 MBean 信息,例如 MessageCount、运行状态等。 我不知道如何远程连接到 MBean 服务器。
VisualVM 有两种连接远程 JMX 服务器的方式。 主机名:端口或 服务:jmx::
MBeanServer 是否有运行的默认端口? 是否使 MBean 能够远程访问?是否需要执行任何操作才能远程访问 MBean?
谢谢
最佳答案
JMX 使用 JSR-160 连接器,使用 RMI,这对防火墙不是特别友好。
您还需要启用远程访问,包括端口;请参阅oracle documentation .
Spring 提供了支持类,允许您访问另一个 Spring 应用程序中的 MBean see the Spring JMX documentation .
最后,您可以考虑使用类似 jolokia 的内容作为 JSR-160 的替代方案,通过 HTTP 公开您的 MBean。
关于java - 如何在Spring集成中连接到远程MBean服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37602260/