侧边栏壁纸
博主头像
落叶人生博主等级

走进秋风,寻找秋天的落叶

  • 累计撰写 130562 篇文章
  • 累计创建 28 个标签
  • 累计收到 9 条评论
标签搜索

目 录CONTENT

文章目录

RocketMQ官方文档翻译-1

2023-11-17 星期五 / 0 评论 / 0 点赞 / 60 阅读 / 2555 字

Quick Start This quick start guide is to give detailed instructions, helping you setup RocketMQ mess

Quick Start

This quick start guide is to give detailed instructions, helping you setup RocketMQ messaging system on a single local machine and send/receive the very first message.

快速启动

本快速入门指南给予详细的说明,帮助你建立单机的rocketmq消息系统,发送/接收的第一个消息。

Prerequisite

The following softwares are assumed installed:

  1. 64bit OS, Linux/Unix/Mac is recommended;
  2. 64bit JDK 1.7+;
  3. Maven 3.2.x
  4. Git

Clone & Build

  > 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 &  > 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...

you may need to pay attention to the broker ip, for that the broker will not use the loopback network interface, So you should make sure you have connected to other network.

 

Send & Receive Messages

Before sending/receiving messages, we need to tell clients where name servers are located. 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...

 

在接收和发送消息之前,我们需要告诉客户端,nameserver位于哪里,有多种方法,我们使用最简单的,环境变量 NAMESRV_ADDR 

 

Shutdown Servers

> sh bin/mqshutdown brokerThe mqbroker(36695) is running...Send shutdown request to mqbroker(36695) OK> sh bin/mqshutdown namesrvThe mqnamesrv(36664) is running...Send shutdown request to mqnamesrv(36664) OK

 

 

广告 广告

评论区