Open Command Prompt as Administrator and navigate to the ActiveMQ bin directory:
cd <ACTIVEMQ_HOME>\binRun the encryption command:
activemq encrypt --password activemq --input <your_password>activemq encrypt --password activemq --input snehalEncrypted text: sUBa0wl6rQQeW8HU6TFIUw==Note: Save the encrypted value. It will be used in configuration files.
<ACTIVEMQ_HOME>\conf\credentials-enc.propertiesAdd or update the following entries:
aeuser.password=ENC(sUBa0wl6rQQeW8HU6TFIUw==)
activemq.username=admin
activemq.password=ENC(sUBa0wl6rQQeW8HU6TFIUw==)<ACTIVEMQ_HOME>\conf\activemq.xml<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<value>file:${activemq.conf}/credentials.properties</value>
</property></bean><ACTIVEMQ_HOME>\conf\activemq.xmlAdd the following Spring beans under <beans>:
<bean id="environmentVariablesConfiguration"class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
<property name="algorithm" value="PBEWithMD5AndDES"/>
<property name="passwordEnvName" value="ACTIVEMQ_ENCRYPTION_PASSWORD"/></bean>
<bean id="configurationEncryptor"class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
<property name="config" ref="environmentVariablesConfiguration"/></bean>
<bean id="propertyConfigurer"class="org.jasypt.spring4.properties.EncryptablePropertyPlaceholderConfigurer">
<constructor-arg ref="configurationEncryptor"/>
<property name="location" value="file:${activemq.conf}/credentials-enc.properties"/></bean>Inside the <broker> section of activemq.xml, add:
<plugins>
<simpleAuthenticationPlugin anonymousAccessAllowed="false">
<users>
<authenticationUserusername="admin"password="${aeuser.password}"groups="admins,users"/>
</users>
</simpleAuthenticationPlugin></plugins>✔ Anonymous access disabled
✔ Authentication enforced
Set the encryption password as a SYSTEM environment variable:
setx ACTIVEMQ_ENCRYPTION_PASSWORD "activemq" /MImportant: Restart the server or ActiveMQ service after setting this variable.
<AE_HOME>\ae.propertiesAdd or verify:
activemq.broker.url=tcp://localhost:61616
mq.username=admin
mq.password=snehalNote: AE uses the plain password; ActiveMQ validates it against the encrypted value.
net stop AutomationEdge
net stop ActiveMQ
net start ActiveMQ
net start AutomationEdge⚠ Ensure only one ActiveMQ instance is running on port 61616.
<ACTIVEMQ_HOME>\conf\activemq.xmlEnsure broker has:
<broker useJmx="true" ...><ACTIVEMQ_HOME>\conf\jmx.accessadmin readwrite
monitor readonly<ACTIVEMQ_HOME>\conf\jmx.passwordadmin Jmx@123
monitor Monitor@123⚠ Passwords are stored in clear text by JVM design.
Run CMD as Administrator:
cd <ACTIVEMQ_HOME>\conf
icacls jmx.password /inheritance:r
icacls jmx.password /grant "%USERNAME%:R"
icacls jmx.password /grant "Administrators:R"✔ Only owner and administrators have read access
✔ ActiveMQ will fail to start if permissions are weak (expected behavior)
<ACTIVEMQ_HOME>\bin\activemq.batAdd:
set ACTIVEMQ_OPTS=%ACTIVEMQ_OPTS% ^
-Dcom.sun.management.jmxremote ^
-Dcom.sun.management.jmxremote.port=1234 ^
-Dcom.sun.management.jmxremote.rmi.port=1234 ^
-Djava.rmi.server.hostname=localhost ^
-Dcom.sun.management.jmxremote.authenticate=true ^
-Dcom.sun.management.jmxremote.ssl=false ^
-Dcom.sun.management.jmxremote.password.file="%ACTIVEMQ_CONF%\jmx.password" ^
-Dcom.sun.management.jmxremote.access.file="%ACTIVEMQ_CONF%\jmx.access"net stop ActiveMQ
net start ActiveMQUsing JConsole:
Connection URL:
service:jmx:rmi:///jndi/rmi://localhost:1234/jmxrmiCredentials:
Username: admin Password: Jmx@123 ✔ Successful connection
✔ Invalid credentials are rejected