Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default port for JMX in ActiveMQ?

Tags:

java

activemq

jmx

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.

like image 661
Lwin Htoo Ko Avatar asked Nov 20 '12 08:11

Lwin Htoo Ko


2 Answers

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

like image 148
Dijesh Avatar answered Sep 17 '22 05:09

Dijesh


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();
like image 27
Pierluigi Vernetto Avatar answered Sep 18 '22 05:09

Pierluigi Vernetto