imran raza khan created AMQ-9812:
------------------------------------

             Summary: ActiveMQ Classic Docker Container Ignores 
ACTIVEMQ_OPTS_MEMORY Environment Variable
                 Key: AMQ-9812
                 URL: https://issues.apache.org/jira/browse/AMQ-9812
             Project: ActiveMQ
          Issue Type: Bug
          Components: AMQP
    Affects Versions: 6.1.8
            Reporter: imran raza khan


While running ActiveMQ Classic using the official Docker image:


{code:java}
apache/activemq-classic:6.2.0 or  apache/activemq-classic:6.1.8
{code}


I attempted to override JVM memory settings using the environment variable 
defined in the official Dockerfile:


{code:java}
ENV ACTIVEMQ_OPTS_MEMORY -Xms64M -Xmx1G
{code}


I started the container with:

{code:java}
docker run -d \
  -e ACTIVEMQ_OPTS_MEMORY="-Xms512M -Xmx2G" \
  -p 61616:61616 \
  -p 8161:8161 \
  apache/activemq-classic:6.2.0
{code}


Expected Result:
ActiveMQ should start with JVM args:
-Xms512M -Xmx2G

Actual Result:
Container logs always show:

{code:java}
$ docker run    -e ACTIVEMQ_OPTS_MEMORY="-Xms512M -Xmx2G"   -p 61616:61616   -p 
8161:8161   apache/activemq-classic:6.2.0
INFO: Loading '/opt/apache-activemq/bin/setenv'
INFO: Using java '/opt/java/openjdk/bin/java'
INFO: Starting in foreground, this is just for debugging purposes (stop process 
by pressing CTRL+C)
INFO: Creating pidfile /opt/apache-activemq/data/activemq.pid
Java Runtime: Eclipse Adoptium 17.0.17 /opt/java/openjdk
  Heap sizes: current=67584k  free=60645k  max=1048576k
    JVM args: -Xms64M -Xmx1G -Djava.util.logging.config.file=logging.properties 
-Djava.security.auth.login.config=/opt/apache-activemq/conf/login.config 
-Djetty.host=0.0.0.0 -Dcom.sun.management.jmxremote -Djava.awt.headless=true 
-Djava.io.tmpdir=/opt/apache-activemq/tmp --add-reads=java.xml=java.logging 
--add-opens=java.base/java.security=ALL-UNNAMED 
--add-opens=java.base/java.net=ALL-UNNAMED 
--add-opens=java.base/java.lang=ALL-UNNAMED 
--add-opens=java.base/java.util=ALL-UNNAMED 
--add-opens=java.naming/javax.naming.spi=ALL-UNNAMED 
--add-opens=java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED 
--add-opens=java.base/java.util.concurrent=ALL-UNNAMED 
--add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED 
--add-opens=java.base/sun.nio.ch=ALL-UNNAMED 
--add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED 
--add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED 
--add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED 
--add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED 
--add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED 
-Dactivemq.classpath=/opt/apache-activemq/conf: 
-Dactivemq.home=/opt/apache-activemq -Dactivemq.base=/opt/apache-activemq 
-Dactivemq.conf=/opt/apache-activemq/conf 
-Dactivemq.data=/opt/apache-activemq/data 
-Djolokia.conf=file:/opt/apache-activemq/conf/jolokia-access.xml
Extensions classpath:
  
[/opt/apache-activemq/lib,/opt/apache-activemq/lib/camel,/opt/apache-activemq/lib/optional,/opt/apache-activemq/lib/web,/opt/apache-activemq/lib/extra]
ACTIVEMQ_HOME: /opt/apache-activemq
ACTIVEMQ_BASE: /opt/apache-activemq
ACTIVEMQ_CONF: /opt/apache-activemq/conf
ACTIVEMQ_DATA: /opt/apache-activemq/data
Loading message broker from: xbean:activemq.xml
{code}


This means the container ignores the user-provided ACTIVEMQ_OPTS_MEMORY 
variable and falls back to the default.





--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to