Skip to content

🚀🚀RocketMQ 入门、RocketMQ 集成 SpringBoot、Spring Cloud Stream RocketMQ 集成实践、快速上手 RocketMQ、部分底层源码分析(查看 MarkDown 中文档地址)👏👏

Notifications You must be signed in to change notification settings

ShayLau/RocketMQ-Demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RocketMQ-Demo项目说明

MQ 简介

MQ的作用

  • 应用解耦
  • 流量削锋
  • 数据分发

使用 MQ 的缺点

可用性降低、MQ 宕机影响业务、系统复杂度提高(重复消费、消息丢失、消息顺序性)、一致性问题

RocketMQ 单机启动

启动 NameSrv

配置(默认端口 9876)

./mqnamesrv &

启动 boker

broker 的默认端口是 10911

./mqbroker -n localhost:9876  -c ../conf/broker.conf  autoCreateTopicEnable=true &

关闭 NameSrv

./mqshutdown namesrv

关闭 boker

./mqshutdown broker

测试 RocketMQ是否正常运行

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...
  • 配置环境变量
export NAMESRV_ADDR=localhost:9876
  • 生产消息
./tools.sh org.apache.rocketmq.example.quickstart.Producer
  • 消费消息
./tools.sh org.apache.rocketmq.example.quickstart.Consumer

RocketMQ 教程系列文章说明

消息生产者

RocketMQ 消息生产者详细说明

消息消费者

RocketMQ 消息消费者详细说明

消息事务

RocketMQ 事务详解

RocketMQ集成 Springboot

RocketMQ 集成 Springboot

分布式应用集成Spring Cloud Stream RocketMQ说明

Spring Cloud Stream RocketMQ(一) 消息发送接收初试 Spring Cloud Stream RocketMQ(二) Binder 源码分析 Spring Cloud Stream RocketMQ(三)发送源码分析 Spring Cloud Stream RocketMQ(四)消费源码分析

参考文档

About

🚀🚀RocketMQ 入门、RocketMQ 集成 SpringBoot、Spring Cloud Stream RocketMQ 集成实践、快速上手 RocketMQ、部分底层源码分析(查看 MarkDown 中文档地址)👏👏

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages