跳转到正文

Docker 验证证据 ​

ActiveMQ Classic 已验证 · Verified 🕒 快照采集: 2026-08-23 15:19:49 UTC
🐳 镜像:server:apache/activemq-classic:6.2.0
🛠️ 关键工具:activemqactivemq-admin
🔨 构建/检查管理命令与目标检查
🚀 运行/交互CLI/内置示例完成生产、消费与复查
docker-session.out.txt
## status
[cli-tools] $ /opt/apache-activemq/bin/activemq status
INFO: Loading '/opt/apache-activemq/bin/setenv'
INFO: Using java '/opt/java/openjdk/bin/java'
ActiveMQ is running (pid '1')

## create
[cli-tools] $ /opt/apache-activemq/bin/activemq producer --destination queue://orders-cli --messageCount 1 --message order-cli-1
INFO: Loading '/opt/apache-activemq/bin/setenv'
INFO: Using java '/opt/java/openjdk/bin/java'
Java Runtime: Eclipse Adoptium 17.0.17 /opt/java/openjdk
  Heap sizes: current=67584k  free=65684k  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 --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
 INFO | Connecting to URL: failover://tcp://localhost:61616 as user: null
 INFO | Producing messages to queue://orders-cli
 INFO | Using persistent messages
 INFO | Sleeping between sends 0 ms
 INFO | Running 1 parallel threads
 INFO | Successfully connected to tcp://localhost:61616
 INFO | producer-1 Started to calculate elapsed time ...

 INFO | producer-1 Produced: 1 messages
 INFO | producer-1 Elapsed time in second : 0 s
 INFO | producer-1 Elapsed time in milli second : 18 milli seconds

## produce
[cli-tools] $ for i in 2 3: /opt/apache-activemq/bin/activemq producer --destination queue://orders-cli --messageCount 1 --message order-cli-$i ...
INFO: Loading '/opt/apache-activemq/bin/setenv'
INFO: Using java '/opt/java/openjdk/bin/java'
Java Runtime: Eclipse Adoptium 17.0.17 /opt/java/openjdk
  Heap sizes: current=67584k  free=65909k  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 --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
 INFO | Connecting to URL: failover://tcp://localhost:61616 as user: null
 INFO | Producing messages to queue://orders-cli
 INFO | Using persistent messages
 INFO | Sleeping between sends 0 ms
 INFO | Running 1 parallel threads
 INFO | Successfully connected to tcp://localhost:61616
 INFO | producer-1 Started to calculate elapsed time ...

 INFO | producer-1 Produced: 1 messages
 INFO | producer-1 Elapsed time in second : 0 s
 INFO | producer-1 Elapsed time in milli second : 10 milli seconds
INFO: Loading '/opt/apache-activemq/bin/setenv'
INFO: Using java '/opt/java/openjdk/bin/java'
Java Runtime: Eclipse Adoptium 17.0.17 /opt/java/openjdk
  Heap sizes: current=67584k  free=65684k  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 --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
 INFO | Connecting to URL: failover://tcp://localhost:61616 as user: null
 INFO | Producing messages to queue://orders-cli
 INFO | Using persistent messages
 INFO | Sleeping between sends 0 ms
 INFO | Running 1 parallel threads
 INFO | Successfully connected to tcp://localhost:61616
 INFO | producer-1 Started to calculate elapsed time ...

 INFO | producer-1 Produced: 1 messages
 INFO | producer-1 Elapsed time in second : 0 s
 INFO | producer-1 Elapsed time in milli second : 5 milli seconds

## consume
[cli-tools] $ /opt/apache-activemq/bin/activemq consumer --destination queue://orders-cli --messageCount 3
INFO: Loading '/opt/apache-activemq/bin/setenv'
INFO: Using java '/opt/java/openjdk/bin/java'
Java Runtime: Eclipse Adoptium 17.0.17 /opt/java/openjdk
  Heap sizes: current=67584k  free=65684k  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 --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
 INFO | Connecting to URL: failover://tcp://localhost:61616 as user: null
 INFO | Consuming queue://orders-cli
 INFO | Sleeping between receives 0 ms
 INFO | Running 1 parallel threads
 INFO | Successfully connected to tcp://localhost:61616
 INFO | consumer-1 wait until 3 messages are consumed
 INFO | consumer-1 Received order-cli-1
 INFO | consumer-1 Received order-cli-2
 INFO | consumer-1 Received order-cli-3
 INFO | consumer-1 Consumed: 3 messages
 INFO | consumer-1 Consumer thread finished

## verify
[cli-tools] $ timeout 15 /opt/apache-activemq/bin/activemq consumer --destination queue://orders-cli --messageCount 1(空队列将阻塞至被 timeout 杀掉,预期 exit 124)
INFO: Loading '/opt/apache-activemq/bin/setenv'
INFO: Using java '/opt/java/openjdk/bin/java'
Java Runtime: Eclipse Adoptium 17.0.17 /opt/java/openjdk
  Heap sizes: current=67584k  free=65684k  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 --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
 INFO | Connecting to URL: failover://tcp://localhost:61616 as user: null
 INFO | Consuming queue://orders-cli
 INFO | Sleeping between receives 0 ms
 INFO | Running 1 parallel threads
 INFO | Successfully connected to tcp://localhost:61616
 INFO | consumer-1 wait until 1 messages are consumed
[cli-tools] verify exitCode=124(124=被 timeout 杀掉,说明队列已空)

以统一实验验证消息系统语义边界