安装需求:
- 64位的系统 Linux/Unix/Mac
- 64bit JDK 1.8+;
- Maven 3.2.x;
- Git (一般自带)
如果还未安装jdk、maven建议查看教程:点击查看
Clone & Build
1 | git clone -b develop https://github.com/apache/incubator-rocketmq.git |
Start Name Server
1 | nohup sh bin/mqnamesrv & |
Start Broker
1 | nohup sh bin/mqbroker -n localhost:9876 & |
Send & Receive Messages
1 | Before sending/receiving messages, we need to tell clients the location of name servers. RocketMQ provides multiple ways to achieve this. For simplicity, we use environment variable NAMESRV_ADDR |
Shutdown Servers
1 | sh bin/mqshutdown broker |