You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by ji...@apache.org on 2023/03/27 07:26:18 UTC

[rocketmq] branch develop updated: [ISSUE #6445] Fix the attribute of the compaction topic doc (#6451)

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

jinrongtong pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/rocketmq.git


The following commit(s) were added to refs/heads/develop by this push:
     new 9b90b5b70 [ISSUE #6445] Fix the attribute of the compaction topic doc (#6451)
9b90b5b70 is described below

commit 9b90b5b70ab284b56e16ffceff565f10af33b0c1
Author: Oliver <wq...@163.com>
AuthorDate: Mon Mar 27 15:26:10 2023 +0800

    [ISSUE #6445] Fix the attribute of the compaction topic doc (#6451)
---
 docs/cn/Example_Compaction_Topic_cn.md | 6 +++---
 docs/en/Example_Compaction_Topic.md    | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/docs/cn/Example_Compaction_Topic_cn.md b/docs/cn/Example_Compaction_Topic_cn.md
index 9793fccd5..6ebb5a986 100644
--- a/docs/cn/Example_Compaction_Topic_cn.md
+++ b/docs/cn/Example_Compaction_Topic_cn.md
@@ -13,7 +13,7 @@ $ bin/mqadmin updateNamesrvConfig -k orderMessageEnable -v true
 ```shell
 $ bin/mqadmin updateTopic -w 8 -r 8 -a +cleanup.policy=COMPACTION -n localhost:9876 -t ctopic -o true -c DefaultCluster
 create topic to 127.0.0.1:10911 success.
-TopicConfig [topicName=ctopic, readQueueNums=8, writeQueueNums=8, perm=RW-, topicFilterType=SINGLE_TAG, topicSysFlag=0, order=false, attributes={+delete.policy=COMPACTION}]
+TopicConfig [topicName=ctopic, readQueueNums=8, writeQueueNums=8, perm=RW-, topicFilterType=SINGLE_TAG, topicSysFlag=0, order=false, attributes={+cleanup.policy=COMPACTION}]
 ```
 
 ### 生产数据
@@ -28,7 +28,7 @@ producer.start();
 String topic = "ctopic";
 String tag = "tag1";
 String key = "key1";
-Message msg = new Message(topic, tag, key, "bodys"getBytes(StandardCharsets.UTF_8));
+Message msg = new Message(topic, tag, key, "bodys".getBytes(StandardCharsets.UTF_8));
 SendResult sendResult = producer.send(msg, (mqs, message, shardingKey) -> {
     int select = Math.abs(shardingKey.hashCode());
     if (select < 0) {
@@ -64,7 +64,7 @@ messageQueueList.forEach(mq -> {
 Map<String, byte[]> kvStore = Maps.newHashMap();
 while (true) {
     List<MessageExt> msgList = consumer.poll(1000);
-    if (msgList != null) {
+    if (CollectionUtils.isNotEmpty(msgList)) {
         msgList.forEach(msg -> kvStore.put(msg.getKeys(), msg.getBody()));
     }
 }
diff --git a/docs/en/Example_Compaction_Topic.md b/docs/en/Example_Compaction_Topic.md
index 76af95902..ed5528686 100644
--- a/docs/en/Example_Compaction_Topic.md
+++ b/docs/en/Example_Compaction_Topic.md
@@ -12,7 +12,7 @@ $ bin/mqadmin updateNamesrvConfig -k orderMessageEnable -v true
 ```shell
 $ bin/mqadmin updateTopic -w 8 -r 8 -a +cleanup.policy=COMPACTION -n localhost:9876 -t ctopic -o true -c DefaultCluster
 create topic to 127.0.0.1:10911 success.
-TopicConfig [topicName=ctopic, readQueueNums=8, writeQueueNums=8, perm=RW-, topicFilterType=SINGLE_TAG, topicSysFlag=0, order=false, attributes={+delete.policy=COMPACTION}]
+TopicConfig [topicName=ctopic, readQueueNums=8, writeQueueNums=8, perm=RW-, topicFilterType=SINGLE_TAG, topicSysFlag=0, order=false, attributes={+cleanup.policy=COMPACTION}]
 ```
 
 ### produce message
@@ -25,7 +25,7 @@ producer.start();
 String topic = "ctopic";
 String tag = "tag1";
 String key = "key1";
-Message msg = new Message(topic, tag, key, "bodys"getBytes(StandardCharsets.UTF_8));
+Message msg = new Message(topic, tag, key, "bodys".getBytes(StandardCharsets.UTF_8));
 SendResult sendResult = producer.send(msg, (mqs, message, shardingKey) -> {
     int select = Math.abs(shardingKey.hashCode());
     if (select < 0) {
@@ -59,7 +59,7 @@ messageQueueList.forEach(mq -> {
 Map<String, byte[]> kvStore = Maps.newHashMap();
 while (true) {
     List<MessageExt> msgList = consumer.poll(1000);
-    if (msgList != null) {
+    if (CollectionUtils.isNotEmpty(msgList)) {
         msgList.forEach(msg -> kvStore.put(msg.getKeys(), msg.getBody()));
     }
 }