I am using the latest
official ActiveMQ Classic 6 Docker image via Docker Desktop. However, authorization doesn't work with default credentials (i.e. admin
/admin
). I am getting 401 unauthorized error. Does anyone know why?
I tried the same with ActiveMQ Classic 5.18.3, and I managed to authorize with default credentials.
Successful authorization.
Best solutions it to use correct ACTIVEMQ_OPTS
. Here is example for docker compose
:
version: '3.8'
services:
amq:
image: apache/activemq-classic:6.0.1
environment:
- ACTIVEMQ_OPTS= -Djetty.host=0.0.0.0 -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=/opt/apache-activemq/conf/login.config
ports:
- "8161:8161"
- "61616:61616"
tl;dr;
Looks like, due to web interface not being accessible by default in docker, they added ACTIVEMQ_OPTS= -Djetty.host=0.0.0.0
as default environment variable in docker. This prevents ACTIVEMQ_OPTS
to be set to same value as if would be empty (like usual local installation).
if [ -z "$ACTIVEMQ_OPTS" ] ; then
ACTIVEMQ_OPTS="$ACTIVEMQ_OPTS_MEMORY -Djava.util.logging.config.file=logging.properties -Djava.security.auth.login.config=$ACTIVEMQ_CONF/login.config"
fi