提交 5b29b73c 编写于 作者: Y ymwneu 提交者: Heng Du

Set auto commit (#914)

上级 92ec70b4
...@@ -40,7 +40,7 @@ public class Consumer { ...@@ -40,7 +40,7 @@ public class Consumer {
@Override @Override
public ConsumeOrderlyStatus consumeMessage(List<MessageExt> msgs, ConsumeOrderlyContext context) { public ConsumeOrderlyStatus consumeMessage(List<MessageExt> msgs, ConsumeOrderlyContext context) {
context.setAutoCommit(false); context.setAutoCommit(true);
System.out.printf("%s Receive New Messages: %s %n", Thread.currentThread().getName(), msgs); System.out.printf("%s Receive New Messages: %s %n", Thread.currentThread().getName(), msgs);
this.consumeTimes.incrementAndGet(); this.consumeTimes.incrementAndGet();
if ((this.consumeTimes.get() % 2) == 0) { if ((this.consumeTimes.get() % 2) == 0) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册