yx9o commented on code in PR #11480:
URL: https://github.com/apache/rocketmq/pull/11480#discussion_r4510196623
##########
client/src/main/java/org/apache/rocketmq/client/impl/consumer/ConsumeMessagePopOrderlyService.java:
##########
@@ -217,7 +241,45 @@ public boolean processConsumeResult(
final ConsumeOrderlyContext context,
final ConsumeRequest consumeRequest
) {
- return true;
+ if (msgs == null || msgs.isEmpty()) {
+ return true;
+ }
+
+ String topic = consumeRequest.getMessageQueue().getTopic();
+
+ // POP mode has no local offset to advance. COMMIT and SUCCESS both
mean that the broker
+ // can forget the popped copy, while ROLLBACK and SUSPEND keep it
available for redelivery.
+ if (ConsumeOrderlyStatus.SUCCESS == status ||
ConsumeOrderlyStatus.COMMIT == status) {
Review Comment:
Could we preserve messages when context.isAutoCommit() is false instead of
ACKing SUCCESS here? Manual-commit listeners intentionally return SUCCESS
before a later COMMIT or ROLLBACK, so this branch acknowledges their messages
prematurely and a subsequent rollback or consumer failure can no longer
redeliver them.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]