Skip to content

[ISSUE #380] Fix message track showing NOT_CONSUME_YET for consumed messages#10595

Closed
itxaiohanglover wants to merge 2 commits into
apache:developfrom
itxaiohanglover:fix/message-track-not-consume-yet
Closed

[ISSUE #380] Fix message track showing NOT_CONSUME_YET for consumed messages#10595
itxaiohanglover wants to merge 2 commits into
apache:developfrom
itxaiohanglover:fix/message-track-not-consume-yet

Conversation

@itxaiohanglover

Copy link
Copy Markdown

What is the purpose of the change

Fixes apache/rocketmq-dashboard#380

In DefaultMQAdminExtImpl.consumed() and consumedConcurrent(), the consumer offset comparison used strict > instead of >=. When the consumer offset exactly matched the message's queue offset, the message was incorrectly reported as NOT_CONSUME_YET instead of CONSUMED.

Brief changelog

  • Changed > to >= in consumed() method
  • Changed > to >= in consumedConcurrent() method
  • Added test testConsumedWithEqualOffset verifying the fix

Verifying this change

Added test case testConsumedWithEqualOffset that sets consumerOffset equal to the message's queueOffset and verifies consumed() returns true.

…umed messages

In DefaultMQAdminExtImpl.consumed() and consumedConcurrent(), the
consumer offset comparison used strict greater-than (>) instead of
greater-than-or-equal (>=). When the consumer offset exactly matched
the message's queue offset, the message was incorrectly reported as
NOT_CONSUME_YET instead of CONSUMED.

This affected the dashboard's message track view, where messages that
were just consumed would still show as "NOT_CONSUME_YET".

@yx9o yx9o left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this change is correct. consumerOffset means the next offset to consume, so the current > check is expected.

@itxaiohanglover

Copy link
Copy Markdown
Author

Thank you for the review @yx9o. You're right — consumerOffset represents the next offset to consume, so the current > check is correct. A message at exactly consumerOffset hasn't been consumed yet.

Closing this PR as the fix is incorrect. I'll re-investigate the root cause of the dashboard issue #380 to find the actual source of the false NOT_CONSUME_YET status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

消息已经消费了,为什么显示还是NOT_CONSUME_YET

2 participants