ActiveMQ(一)入门

来源:互联网 发布:东方财富通软件下载 编辑:程序博客网 时间:2024/06/06 18:49

最近项目要用到消息队列,于是就研究了activemq。

一、安装

在http://activemq.apache.org/download-archives.html下载最新版本的activemq,我下的版本是5.10.0,linux的,

activemq需要java的运行环境,因为它本来就是java实现的。

5.10.0及以前的版本需要jre1.6,

5.11.1版本就需要jre1.7了。

在安装activemq之前,请保证你已经安装了jre。

输入命令

tar zxvf activemq-x.x.x-bin.tar.gz
可以看到activemq的目录:

[root@localhost apache-activemq-5.10.0]$ ll
总用量 6320
-rwxr-xr-x    1 root     root      6371237 2014-06-05  activemq-all-5.10.0.jar
drwxr-xr-x    5 root     root         4096  7月 26 23:39 bin
drwxr-xr-x    2 root     root         4096  7月 26 17:15 conf
drwxr-xr-x    3 root     root         4096  7月 26 23:39 data
drwxr-xr-x    2 root     root         4096  7月 26 17:15 docs
drwxr-xr-x    8 root     root         4096  7月 26 17:15 examples
drwxr-xr-x    6 root     root         4096  7月 26 17:15 lib
-rw-r--r--    1 root     root        40580 2014-06-05  LICENSE
-rw-r--r--    1 root     root         3334 2014-06-05  NOTICE
-rw-r--r--    1 root     root         2610 2014-06-05  README.txt
drwxr-xr-x    2 root     root         4096  7月 28 22:51 tmp
drwxr-xr-x    7 root     root         4096  7月 26 17:15 webapps
drwxr-xr-x    3 root     root         4096  7月 26 17:15 webapps-demo

进入目录bin

输入命令:

./activemq start

这样activemq就启动。

通过http://localhost:8161可以访问activemq的页面了

可以通过 "Manage ActiveMQ broker",输入账号密码(admin / admin)进入管理页面

账号 / 密码 在文件conf/jetty-realm.properties:

# Defines users that can access the web (console, demo, etc.)# username: password [,rolename ...]admin: admin, admin
查看activemq的状态,输入命令:

bin/activemq status

关闭activemq,输入命令:

bin/activemq stop


0 0
原创粉丝点击