From 965ebb7081dd1a1072a111136db08b0b9f4f7575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=B9=9B=E6=B9=9B?= Date: Mon, 27 May 2024 16:03:14 +0800 Subject: [PATCH 1/2] fix: update why-mq.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit mq-1.png和mq-2.png中均为D系统不需要消费 --- docs/high-concurrency/why-mq.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/high-concurrency/why-mq.md b/docs/high-concurrency/why-mq.md index c4c8ddab9..5b0314124 100644 --- a/docs/high-concurrency/why-mq.md +++ b/docs/high-concurrency/why-mq.md @@ -36,7 +36,7 @@ #### 解耦 -看这么个场景。A 系统发送数据到 BCD 三个系统,通过接口调用发送。如果 E 系统也要这个数据呢?那如果 C 系统现在不需要了呢?A 系统负责人几乎崩溃...... +看这么个场景。A 系统发送数据到 BCD 三个系统,通过接口调用发送。如果 E 系统也要这个数据呢?那如果 D 系统现在不需要了呢?A 系统负责人几乎崩溃...... ![mq-1](./images/mq-1.png) From 34d97db12a5c68554d0a10fe82a082792504f4f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B2=81=E6=B9=9B=E6=B9=9B?= Date: Wed, 29 May 2024 12:00:02 +0800 Subject: [PATCH 2/2] docs: modifying how-to-ensure-the-reliable-transmission-of-messages.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更正拼写错误 --- .../how-to-ensure-the-reliable-transmission-of-messages.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/high-concurrency/how-to-ensure-the-reliable-transmission-of-messages.md b/docs/high-concurrency/how-to-ensure-the-reliable-transmission-of-messages.md index 69eff3f4e..2a4cc712f 100644 --- a/docs/high-concurrency/how-to-ensure-the-reliable-transmission-of-messages.md +++ b/docs/high-concurrency/how-to-ensure-the-reliable-transmission-of-messages.md @@ -178,9 +178,9 @@ RabbitMQ 如果丢失了数据,主要是因为你消费的时候,**刚消费 #### 生产者发送消息时如何保证不丢失? -解决发送时消息丢失的问题可以采用 RocketMQ 自带的**事物消息**机制 +解决发送时消息丢失的问题可以采用 RocketMQ 自带的**事务消息**机制 -事物消息原理:首先生产者会发送一个**half 消息**(对原始消息的封装),该消息对消费者不可见,MQ 通过 ACK 机制返回消息接受状态, 生产者执行本地事务并且返回给 MQ 一个状态(Commit、RollBack 等),如果是 Commit 的话 MQ 就会把消息给到下游, RollBack 的话就会丢弃该消息,状态如果为 UnKnow 的话会过一段时间回查本地事务状态,默认回查 15 次,一直是 UnKnow 状态的话就会丢弃此消息。 +事务消息原理:首先生产者会发送一个**half 消息**(对原始消息的封装),该消息对消费者不可见,MQ 通过 ACK 机制返回消息接受状态, 生产者执行本地事务并且返回给 MQ 一个状态(Commit、RollBack 等),如果是 Commit 的话 MQ 就会把消息给到下游, RollBack 的话就会丢弃该消息,状态如果为 UnKnow 的话会过一段时间回查本地事务状态,默认回查 15 次,一直是 UnKnow 状态的话就会丢弃此消息。 为什么先发一个 half 消息,作用就是先判断下 MQ 有没有问题,服务正不正常。