Skip to content

Commit

Permalink
优化自动提交代码
Browse files Browse the repository at this point in the history
  • Loading branch information
makemyownlife committed Apr 17, 2024
1 parent 760b861 commit 1c07f5f
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@ public void testNoAutoCommit() throws MQClientException {
for (MessageExt messageExt : messageExts) {
// 打印消息内存
System.out.println(new String(first.getBody()));
// 业务处理代码
}
litePullConsumer.commitSync();
// 回滚到第一条消息的点位
litePullConsumer.seek(messageQueue, first.getQueueOffset());
// litePullConsumer.seek(messageQueue, first.getQueueOffset());
}
Thread.sleep(5000);
}
Expand Down

0 comments on commit 1c07f5f

Please sign in to comment.