RocketMQ

2019-04-13  本文已影响0人  SuperGu

Apache RocketMQ


相关地址

Git地址:https://github.com/apache/incubator-rocketmq

快速入门:https://rocketmq.incubator.apache.org/docs/quick-start/

编译好的文件:https://rocketmq.incubator.apache.org/dowloading/releases/


下载源码并进行编译

>  git clone https://github.com/apache/incubator-rocketmq.git

>  cd incubator-rocketmq

>  mvn clean package install -Prelease-all assembly:assembly -U

>  cd target/apache-rocketmq-all/

Start Name Server

> nohup sh bin/mqnamesrv &

> tailf nohup.out

Start Broker

> nohup sh bin/mqbroker -n localhost:9876 &

> tailf nohup.out

注意 如果这里启动失败,看一下内存是否足够,可以看一下“runbroker.sh”这个文件,对应的修改参数,如下

JAVA_OPT="-server -Xms4g -Xmx4g -Xmn2g -XX:PermSize=128m -XX:MaxPermSize=320m"

测试发送与接收

> export NAMESRV_ADDR=localhost:9876

> sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer

> sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer

关闭服务

> sh bin/mqshutdown broker

> sh bin/mqshutdown namesrv

上一篇 下一篇

猜你喜欢

热点阅读