码迷,mamicode.com
首页 > 其他好文 > 详细

active MQ搭建

时间:2014-08-04 18:08:29      阅读:211      评论:0      收藏:0      [点我收藏+]

标签:active mq搭建

ActiveMQ 是Apache出品,最流行的,能力强劲的开源消息总线。ActiveMQ 是一个完全支持JMS1.1和J2EE 1.4规范的 JMS Provider实现,尽管JMS规范出台已经是很久的事情了,但是JMS在当今的J2EE应用中间仍然扮演着特殊的地位。

1安装


定义activemq安装目录为/usr/local/activemq

定义activemq数据存放目录为 /data/postmall/activemq/

cd /tmp

wget http://archive.apache.org/dist/activemq/apache-activemq/5.4.1/apache-activemq-5.4.1-bin.tar.gz

tar -zxvf apache-activemq-5.4.1-bin.tar.gz

mv activemq /usr/local/

vim /usr/local/activemq/conf/activemq.xml


<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="/data/postmall/activemq/data" destroyApplicationContextOnStop="true">

<destinationPolicy>

<policyMap>

<policyEntries>

<policyEntry topic=">" producerFlowControl="true" memoryLimit="64mb">

<pendingSubscriberPolicy>

<vmCursor />

</pendingSubscriberPolicy>

</policyEntry>

<policyEntry queue=">" producerFlowControl="true" memoryLimit="64mb">

</policyEntry>

</policyEntries>

</policyMap>

</destinationPolicy>

<managementContext>

<managementContext createConnector="false"/>

</managementContext>

<persistenceAdapter>

<kahaPersistenceAdapter directory="/data/postmall/activemq/data" maxDataFileLength="32mb"/>

</persistenceAdapter>

<transportConnectors>

<transportConnector name="openwire" uri="tcp://0.0.0.0:61616"/>

</transportConnectors>

</broker>

<import resource="jetty.xml"/>

</beans>



2 启动ActiveMQ

/usr/local/activemq/bin/activemq setup /home/web/.activemqrc

/usr/local/activemq/bin/activemq start

检查activemq是否已经启动并查看日志是否正常

ps -ef | grep active

tail -fn 100 /usr/local/activemq/data/activemq.log

/usr/local/activemq/bin/activemq stop


 3  Activemq 启动脚本

# su - web

Web> cat activemq_61616_restart.sh

#!/bin/bash

# restart activemq port 61616

cd

/usr/local/activemq1/bin/activemq stop

if [ -f /usr/local/activemq1/data/activemq.pid ]

then

rm -f /usr/local/activemq1/data/activemq.pid

fi

sleep 5

/usr/local/activemq1/bin/activemq start







本文出自 “zhanghe” 博客,请务必保留此出处http://9206668.blog.51cto.com/9196668/1535669

active MQ搭建,布布扣,bubuko.com

active MQ搭建

标签:active mq搭建

原文地址:http://9206668.blog.51cto.com/9196668/1535669

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!