You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by du...@apache.org on 2021/08/04 01:18:32 UTC

[rocketmq] branch develop updated: Looking at the Chinese document, I found that the subtraction operation of countdown timer is missing in asynchronous message push, so I downloaded the code. I found that someone added subtraction operation to the demo code in 18 years, but the document was not repaired, so I did this repair

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

duhengforever 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 9d4e8de  Looking at the Chinese document, I found that the subtraction operation of countdown timer is missing in asynchronous message push, so I downloaded the code. I found that someone added subtraction operation to the demo code in 18 years, but the document was not repaired, so I did this repair
     new 0fdc73d  Merge pull request #3033 from zyh-future/zyh_asuncproducer_doc_fix
9d4e8de is described below

commit 9d4e8de315fd60f7a86ad12ca1009d2406d10a89
Author: 张耀辉 <91...@qq.com>
AuthorDate: Wed Jun 23 10:21:53 2021 +0800

    Looking at the Chinese document, I found that the subtraction operation of countdown timer is missing in asynchronous message push, so I downloaded the code. I found that someone added subtraction operation to the demo code in 18 years, but the document was not repaired, so I did this repair
---
 docs/cn/RocketMQ_Example.md | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/docs/cn/RocketMQ_Example.md b/docs/cn/RocketMQ_Example.md
index d924ce1..62961d3 100644
--- a/docs/cn/RocketMQ_Example.md
+++ b/docs/cn/RocketMQ_Example.md
@@ -120,13 +120,15 @@ public class AsyncProducer {
                 producer.send(msg, new SendCallback() {
                     @Override
                     public void onSuccess(SendResult sendResult) {
+                        countDownLatch.countDown();
                         System.out.printf("%-10d OK %s %n", index,
                             sendResult.getMsgId());
                     }
                     @Override
                     public void onException(Throwable e) {
-      	              System.out.printf("%-10d Exception %s %n", index, e);
-      	              e.printStackTrace();
+                        countDownLatch.countDown();
+      	                System.out.printf("%-10d Exception %s %n", index, e);
+      	                e.printStackTrace();
                     }
             	});
     	}