From 9d4e8de315fd60f7a86ad12ca1009d2406d10a89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E8=80=80=E8=BE=89?= <916669644@qq.com> Date: Wed, 23 Jun 2021 10:21:53 +0800 Subject: [PATCH] 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 d924ce1d..62961d31 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(); } }); } -- GitLab