I found a fix, but I'm not sure if it solves the root problem. After starting ActiveMQ, I checked if port 1099 was really open using the following command:
$> netstat -lptun | grep 1099
This command does not display anything, indicating that the port is not open (when starting ActiveMQ). This means that even though ActiveMQ is running, it does not listen for any JMX connections (since the script will try to stop it). After some inspection, I found a link that led me to the file {ACTIVEMQ_HOME} /conf/activemq.xml . This file contains the following section:
<managementContext> <managementContext createConnector="false"/> </managementContext>
Setting createConnector = "true" solved my problems (this will start the MBean server in the JVM when ActiveMQ starts). The shutdown output now looks like this (as expected):
... ACTIVEMQ_HOME: /opt/apache/apache-activemq-5.4.2 ACTIVEMQ_BASE: /opt/apache/apache-activemq-5.4.2 Connecting to JMX URL: service:jmx:rmi:
In addition, after changing this flag, I can verify that the default JMX port (1099) is open after starting ActiveMQ
$> netstat -lptun | grep 1099 tcp 0 0 :::1099 :::* LISTEN 30033/java
cyber-monk
source share