[ 
https://issues.apache.org/jira/browse/AMQ-9812?focusedWorklogId=1004605&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-1004605
 ]

ASF GitHub Bot logged work on AMQ-9812:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Feb/26 14:01
            Start Date: 11/Feb/26 14:01
    Worklog Time Spent: 10m 
      Work Description: jeanouii commented on code in PR #1664:
URL: https://github.com/apache/activemq/pull/1664#discussion_r2793462317


##########
assembly/src/docker/entrypoint.sh:
##########
@@ -78,4 +78,15 @@ if [ -n "${ACTIVEMQ_WEB_USER}" ]; then
   fi
 fi
 
+if [ -z "${ACTIVEMQ_OPTS_MEMORY}" ]; then
+  ACTIVEMQ_OPTS_MEMORY="-Xms64M -Xmx1G"
+  export ACTIVEMQ_OPTS_MEMORY
+fi
+
+if [ -z "${ACTIVEMQ_OPTS}" ]; then
+  # Make the Web console accesible from outside the container if not already 
set

Review Comment:
   Minor type `accessible`





Issue Time Tracking
-------------------

    Worklog Id:     (was: 1004605)
    Time Spent: 0.5h  (was: 20m)

> 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
>            Assignee: Jean-Baptiste Onofré
>            Priority: Major
>             Fix For: 6.3.0, 5.19.2, 6.2.1
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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.
> I tried following option and it works
> {code:java}
>   docker run  \
>   -e ACTIVEMQ_OPTS="-Xms512M -Xmx2G 
> -Djava.util.logging.config.file=logging.properties 
> -Djava.security.auth.login.config=$ACTIVEMQ_CONF/login.config 
> -Djetty.host=0.0.0.0" \
>   -p 61616:61616 \
>   -p 8161:8161 \
>   apache/activemq-classic:6.2.0{code}



--
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