java ActiveMQ 中 JMX 的默认端口是什么?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13469242/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What is the default port for JMX in ActiveMQ?
提问by Lwin Htoo Ko
I am using ActiveMQ 5.3.2 and 5.6.0. In ActiveMQ 5.3.2, the default settings for JMX is
我使用的是 ActiveMQ 5.3.2 和 5.6.0。在 ActiveMQ 5.3.2 中,JMX 的默认设置是
SUNJMX="-Dcom.sun.management.jmxremote"
In ActiveMQ 5.6.0, the default settings for JMX is
在 ActiveMQ 5.6.0 中,JMX 的默认设置是
ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote"
So, these settings have no port definition. Could you tell me ActiveMQ is really starting JMX connection with these settings? If so, what is the default port to connect as I cannot connect to 1099. If port is randomly selected, how to find the port which ActiveMQ is using?
因此,这些设置没有端口定义。你能告诉我 ActiveMQ 真的用这些设置启动了 JMX 连接吗?如果是这样,我无法连接到1099,因此默认连接的端口是什么。如果端口是随机选择的,如何找到ActiveMQ正在使用的端口?
Thanks.
谢谢。
回答by user1802492
Default port is 1099. This can be override by passing jmx parameters as argument to activeMQ in activeMQ start script(activemq.bat or .sh file) . Use property
默认端口是 1099。这可以通过将 jmx 参数作为参数传递给 activeMQ 启动脚本(activemq.bat 或 .sh 文件)中的 activeMQ 来覆盖。使用财产
Dcom.sun.management.jmxremote.portfor setting JMX port
dcom.sun.management.jmxremote.port用于设置 JMX 端口
回答by Pierluigi Vernetto
if you run ActiveMQ Broker in a Spring Boot, this is a simple way to configure the JMX port to the value 11099:
如果您在 Spring Boot 中运行 ActiveMQ Broker,这是一种将 JMX 端口配置为值 11099 的简单方法:
BrokerService broker = new BrokerService();
broker.getManagementContext().setConnectorPort(11099);
broker.getSystemUsage().getStoreUsage().setLimit(100_000_000L);
broker.getSystemUsage().getTempUsage().setLimit(100_000_000L);
TransportConnector connector = new TransportConnector();
connector.setUri(new URI("tcp://localhost:61616?wireFormat.maxInactivityDuration=3000000&wireFormat.maxInactivityDurationInitalDelay=1000000"));
broker.addConnector(connector);
broker.start();