Quick Start

Apache RocketMQ
Documentation
Blog
Community
Users
About

User Guide
    Why RocketMQ
    Quick Start
    Simple Example
    Order Example
    Broadcasting Example
    Schedule Example
    Batch Example
    Filter Example
    Logappender Example
    OpenMessaging Example
    Transaction Example
    FAQ
Release Notes
    Download
Deployment & Operations
    Architecture
    Deployment
    CLI Admin Tool
Contributor Guide
    How To Contribute
    Code Guidelines
    Manage Pull Request
    Release Manual
Best Practice
    Core Concept
    Broker
    Producer
    Consumer
    NameServer
    JVM/Kernel Config

Quick Start

This quick start guide is a detailed instruction of setting up RocketMQ messaging system on your local machine to send and receive messages.
On This Page

Prerequisite
Download & Build from Release
Start Name Server
Start Broker
Send & Receive Messages
Shutdown Servers

Prerequisite

The following softwares are assumed installed:

64bit OS, Linux/Unix/Mac is recommended;
64bit JDK 1.8+;
Maven 3.2.x;
Git;
4g+ free disk for Broker server

Download & Build from Release

Click here to download the 4.7.0 source release. Also you could download a binary release from here.

Now execute the following commands to unpack 4.7.0 source release and build the binary artifact.

unzip rocketmq-all-4.7.0-source-release.zip
cd rocketmq-all-4.7.0/
mvn -Prelease-all -DskipTests clean install -U
cd distribution/target/rocketmq-4.7.0/rocketmq-4.7.0

Start Name Server

nohup sh bin/mqnamesrv &
tail -f ~/logs/rocketmqlogs/namesrv.log
The Name Server boot success…

Start Broker

nohup sh bin/mqbroker -n localhost:9876 &
tail -f ~/logs/rocketmqlogs/broker.log
The broker[%s, 172.30.30.233:10911] boot success…

Send & Receive Messages

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

export NAMESRV_ADDR=localhost:9876
sh bin/tools.sh org.apache.rocketmq.example.quickstart.Producer
SendResult [sendStatus=SEND_OK, msgId= …

sh bin/tools.sh org.apache.rocketmq.example.quickstart.Consumer
ConsumeMessageThread_%d Receive New Messages: [MessageExt…

Shutdown Servers

sh bin/mqshutdown broker
The mqbroker(36695) is running…
Send shutdown request to mqbroker(36695) OK

sh bin/mqshutdown namesrv
The mqnamesrv(36664) is running…
Send shutdown request to mqnamesrv(36664) OK

Updated: February 14, 2020
Share on
Twitter Facebook Google+ LinkedIn
Previous
Next
Leave a Comment
Apache Software Foundation

Follow: Twitter GitHub Feed 

Copyright © 2020 The Apache Software Foundation. Licensed under the Apache License, Version 2.0.
Apache RocketMQ, RocketMQ, Apache, the Apache feather logo and the Apache RocketMQ logo are trademarks of The Apache Software Foundation.

License | Security | Thanks | Sponsorship

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值