create README_en.md

This commit is contained in:
icecheng 2025-09-11 09:57:10 +08:00
parent 1bc32c407c
commit 27bf0098a9
40 changed files with 1366 additions and 15 deletions

View File

@ -1,7 +1,3 @@
# RabbitMQ 培训文档
---
## 1. MQ 的基本概念
### 1.1 什么是MQ
@ -39,20 +35,13 @@ MQ全称为Message Queue即消息队列
**5. 重试与容错**
- 若消费者服务临时故障,消息队列会保留消息,待服务恢复后重新投递
- 配合重试机制,可解决网络波动、服务暂时不可用等问题
#### 典型应用场景:
- 电商下单:订单创建 → 消息队列 → 库存扣减、支付处理、物流通知等
- 日志收集:各服务日志发送到队列,由日志系统统一消费、存储、分析
- 分布式事务:通过消息队列实现最终一致性
- 延迟任务:如订单超时未支付自动取消
---
## 2. RabbitMQ
### 2.1 介绍
RabbitMQ 是一个开源的消息代理软件(也可称为消息队列中间件),由 Erlang 语言编写,基于 AMQP高级消息队列协议 实现,在分布式系统中用于实现应用程序之间的异步通信和解耦。
RabbitMQ 是一个开源的消息代理软件(也可称为消息队列中间件),由 Erlang 语言编写,在分布式系统中用于实现应用程序之间的异步通信和解耦。
#### 特点:
- **多种协议支持**:除了 AMQPRabbitMQ 还支持 STOMP、MQTT 等多种消息协议
@ -62,7 +51,7 @@ RabbitMQ 是一个开源的消息代理软件(也可称为消息队列中间
- **管理界面友好**:具备一个可视化的管理界面
### 2.2 核心组件
![img_6.png](assert/img_6.png)
```
生产者 → 信道 → 交换器(Exchange) → 队列(Queue) → 信道 → 消费者
```
@ -140,6 +129,7 @@ docker run -d --name rabbitmq -p 5673:5672 -p 15673:15672 rabbitmq
## 3. Python集成
基于python aio-pika库进行集成
仓库地址:https://gitea.freeleaps.mathmast.com/icecheng/rabbitmq-test
### 3.1 Fanout Exchange Demo
@ -979,13 +969,12 @@ Message sent: Normal system log (routing key: system.log.info)
**3. 消息幂等性**
- 使用消息ID去重
- 内存中记录已处理的消息ID
- 数据库记录已处理的消息ID
- 防止重复处理相同消息
**4. 重试机制**
- 可配置最大重试次数
- 消费者内部重试,避免消息重新入队
- 指数退避重试策略
**5. 死信队列**
- 处理失败消息的完整解决方案

1362
README_en.md Normal file

File diff suppressed because it is too large Load Diff

BIN
RabbitMQ Usage.docx Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.