What is the default port for JMX in ActiveMQ?
Asked Answered
F

3

5

I am using ActiveMQ 5.3.2 and 5.6.0. In ActiveMQ 5.3.2, the default settings for JMX is

SUNJMX="-Dcom.sun.management.jmxremote"

In ActiveMQ 5.6.0, the default settings for JMX is

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?

Thanks.

Focal answered 20/11, 2012 at 8:33 Comment(1)
See #516642 as the JMX options relate to the JVM and are not ActiveMQ specific.Shaitan
Q
10

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

Dcom.sun.management.jmxremote.port for setting JMX port

Quadricycle answered 4/12, 2012 at 14:14 Comment(1)
Even though the start command has the -Dcom.sun.management.jmxremote parameter, I suppose you have to assure that the broker config has the flag useJmx="true". Am I right ?Cytokinesis
L
1

if you run ActiveMQ Broker in a Spring Boot, this is a simple way to configure the JMX port to the value 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();
Lawerencelawes answered 25/2, 2020 at 17:7 Comment(0)
B
0

By default it doesn't appear to bind to a "default activemq jmx port" however you can modify the activemq file (or environment variables to add one). JMX if you don't specify a port doesn't open one by expicitly stating one.

For instance uncomment this line (or an equivalent in the activemq file for older versions)

 # ACTIVEMQ_SUNJMX_START="$ACTIVEMQ_SUNJMX_START -Dcom.sun.management.jmxremote.port=11099 "

So I guess you could think of that as the "default if you uncomment its config line".

Also when you issue a "stop" command and it doesn't pass a --jmxurl (default is port 11099 in the activemq version I run) it does default to attempting to contact service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi even though the default config isn't listening on that port without modifying configs first. Weird.

Behlau answered 7/1, 2021 at 18:0 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.