ActiveMQ 安装

ActiveMQ 安装

下载 ActiveMQ

https://activemq.apache.org/download-archives
http://archive.apache.org/dist/

入门文档

https://activemq.apache.org/getting-started

版本选择

apache-activemq-5.0.0	1.5.0_12	1.5+
apache-activemq-5.1.0	1.5.0_12	1.5+
apache-activemq-5.2.0	1.5.0_15	1.5+
apache-activemq-5.3.0	1.5.0_17	1.5+
apache-activemq-5.4.0	1.5.0_19	1.5+
apache-activemq-5.5.0	1.6.0_23	1.6+
apache-activemq-5.6.0	1.6.0_26	1.6+
apache-activemq-5.7.0	1.6.0_33	1.6+
apache-activemq-5.8.0	1.6.0_37	1.6+
apache-activemq-5.9.0	1.6.0_51	1.6+
apache-activemq-5.10.0	1.7.0_12-ea	1.7+
apache-activemq-5.11.0	1.7.0_60	1.7+
apache-activemq-5.12.0	1.7.0_80	1.7+
apache-activemq-5.13.0	1.7.0_80	1.7+
apache-activemq-5.14.0	1.7.0_80	1.7+
apache-activemq-5.15.0	1.8.0_112

ActiveMQ 和 JDK 组合

apache-activemq-5.15.0 + jdk1.8.0_201

启动 ActiveMQ

On Windows:

cd [activemq_install_dir]
binactivemq start

On Unix:

From a command shell, change to the installation directory and run ActiveMQ as a foregroud process: 前台启动

cd [activemq_install_dir]/bin
./activemq console

From a command shell, change to the installation directory and run ActiveMQ as a daemon process: 后台启动

cd [activemq_install_dir]/bin
./activemq start

示例

# 启动成功
D:chengxuactivemqapache-activemq-5.15.0>binactivemq start
Java Runtime: Oracle Corporation 1.8.0_181 C:Program FilesJavajdk1.8.0_181jre

启动失败分析

Windows 中不能通过双击 binactivemq.bat 直接启动。必须通过命令行传入 start 参数。

# 启动失败,错误使用右斜杠
D:chengxuactivemqapache-activemq-5.15.0>bin/activemq start
'bin' 不是内部或外部命令,也不是可运行的程序
或批处理文件。

停止 ActiveMQ

For both Windows and Unix installations, terminate ActiveMQ by typing “CTRL-C” in the console or command shell in which it is running.

If ActiveMQ was started in the background on Unix, the process can be killed, with the following:

cd [activemq_install_dir]/bin
./activemq stop

使用管理界面

URL: http://127.0.0.1:8161/admin/
Login: admin
Passwort: admin
Navigate to “Queues” 选择 Queues 选项卡
Add a queue name and click create 创建队列
Send test message by klicking on “Send to” 发送消息

日志文件

[activemq_install_dir]/data/activemq.log

监听端口

ActiveMQ 的默认监听端口是 61616

C:Usersjie>netstat -an|find "61616"
  TCP    0.0.0.0:61616          0.0.0.0:0              LISTENING
  TCP    [::]:61616             [::]:0                 LISTENING

From a Windows console, type:

netstat -an|find "61616"

OR

From a Unix command shell, type:

netstat -nl|grep 61616
原文地址:https://www.cnblogs.com/mozq/p/11326663.html