提交 9d4e8de3 编写于 作者: zyh-mf's avatar zyh-mf

Looking at the Chinese document, I found that the subtraction operation of...

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
上级 df1d93fc
...@@ -120,13 +120,15 @@ public class AsyncProducer { ...@@ -120,13 +120,15 @@ public class AsyncProducer {
producer.send(msg, new SendCallback() { producer.send(msg, new SendCallback() {
@Override @Override
public void onSuccess(SendResult sendResult) { public void onSuccess(SendResult sendResult) {
countDownLatch.countDown();
System.out.printf("%-10d OK %s %n", index, System.out.printf("%-10d OK %s %n", index,
sendResult.getMsgId()); sendResult.getMsgId());
} }
@Override @Override
public void onException(Throwable e) { public void onException(Throwable e) {
System.out.printf("%-10d Exception %s %n", index, e); countDownLatch.countDown();
e.printStackTrace(); System.out.printf("%-10d Exception %s %n", index, e);
e.printStackTrace();
} }
}); });
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册