You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by aa...@apache.org on 2022/06/22 15:25:11 UTC

[rocketmq-clients] branch master updated: Docs: add docs about new message id (WiP) (#13)

This is an automated email from the ASF dual-hosted git repository.

aaronai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git


The following commit(s) were added to refs/heads/master by this push:
     new e58986d  Docs: add docs about new message id (WiP) (#13)
e58986d is described below

commit e58986dc0112c1f1ead21c44847f87eafca9cae4
Author: Aaron Ai <ya...@gmail.com>
AuthorDate: Wed Jun 22 23:25:06 2022 +0800

    Docs: add docs about new message id (WiP) (#13)
---
 docs/artwork/message_id.png | Bin 0 -> 107463 bytes
 docs/design.md              |   3 +++
 docs/message_id.md          |  21 +++++++++++++++++++++
 docs/observability.md       |   0
 4 files changed, 24 insertions(+)

diff --git a/docs/artwork/message_id.png b/docs/artwork/message_id.png
new file mode 100644
index 0000000..058aed0
Binary files /dev/null and b/docs/artwork/message_id.png differ
diff --git a/docs/design.md b/docs/design.md
new file mode 100644
index 0000000..1a438b9
--- /dev/null
+++ b/docs/design.md
@@ -0,0 +1,3 @@
+# Design of RocketMQ clients
+
+As we know in 
\ No newline at end of file
diff --git a/docs/message_id.md b/docs/message_id.md
new file mode 100644
index 0000000..0d1ce1a
--- /dev/null
+++ b/docs/message_id.md
@@ -0,0 +1,21 @@
+# Message Identifier
+
+Here is the new design for message identifier.
+
+## Background
+In the past, there are two types of implementation of message identifier.
+
+1. Message identifier based on the broker address and the offset in message queue, find in [MessageDecoder#createMessageId](https://github.com/apache/rocketmq/blob/release-4.9.3/common/src/main/java/org/apache/rocketmq/common/message/MessageDecoder.java#L62-L71)
+2. Message identifier based on the client IP and unix timestamp, find in [MessageClientIDSetter#createUniqID](https://github.com/apache/rocketmq/blob/release-4.9.3/common/src/main/java/org/apache/rocketmq/common/message/MessageClientIDSetter.java#L114-131)
+
+The first type of message identifier is purely based on server-side information, which makes each message stored on the broker absolutely unique. The second message identifier is purely based on client information.
+
+Both the two types of message identifier have their own shortcomings in the new context.
+
+For the first type, the new message identifier is not expected to be bound to the persistent information. Considering this scenario: a failure to send message triggers automatic retry, resulting in duplicate message. Since the two messages are exactly the same for client, they should have the same message identifier.
+
+As for the second type, the imperfect algorithm design is the greatest flaw. Specifically, when the client runs for more than a month, the probability of message id repetition will be greatly increased.
+
+## Detailed Design
+
+![The Message Identifier Illustration](../docs/artwork/message_id.png)
\ No newline at end of file
diff --git a/docs/observability.md b/docs/observability.md
new file mode 100644
index 0000000..e69de29