Skip to content

[ISSUE #6914]📝Complete consumer section parity with English and fix deps#7033

Open
WaterWhisperer wants to merge 1 commit intomxsm:mainfrom
WaterWhisperer:doc-6914
Open

[ISSUE #6914]📝Complete consumer section parity with English and fix deps#7033
WaterWhisperer wants to merge 1 commit intomxsm:mainfrom
WaterWhisperer:doc-6914

Conversation

@WaterWhisperer
Copy link
Copy Markdown
Contributor

@WaterWhisperer WaterWhisperer commented Apr 1, 2026

Which Issue(s) This PR Fixes(Closes)

Brief Description

How Did You Test This Change?

Summary by CodeRabbit

  • Documentation

    • Updated message filtering best practices to emphasize setting properties for SQL92 filtering support
    • Added comprehensive Chinese consumer documentation covering Push and Pull consumer usage patterns with filtering examples
    • Improved consumer overview with clearer descriptions of message consumption models and benefits
    • Refined documentation navigation structure
  • Chores

    • Removed unused dependency

@rocketmq-rust-bot
Copy link
Copy Markdown
Collaborator

🔊@WaterWhisperer 🚀Thanks for your contribution🎉!

💡CodeRabbit(AI) will review your code first🔥!

Note

🚨The code review suggestions from CodeRabbit are to be used as a reference only, and the PR submitter can decide whether to make changes based on their own judgment. Ultimately, the project management personnel will conduct the final code review💥.

@rocketmq-rust-bot rocketmq-rust-bot requested a review from mxsm April 1, 2026 03:15
@rocketmq-rust-bot rocketmq-rust-bot self-requested a review April 1, 2026 03:15
@rocketmq-rust-robot rocketmq-rust-robot added the documentation📝 Improvements or additions to documentation label Apr 1, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 1, 2026

Walkthrough

This pull request removes the unused chrono dependency from rocketmq-controller and substantially expands RocketMQ consumer documentation in both English and Chinese, adding comprehensive guides for Push Consumer, Pull Consumer, and message filtering with configuration examples and best practices.

Changes

Cohort / File(s) Summary
Dependency Management
rocketmq-controller/Cargo.toml
Removed unused chrono = "0.4" dependency.
Consumer Documentation (English)
docs/consumer/message-filtering.md, docs/consumer/overview.md, docs/consumer/pull-consumer.md, docs/consumer/push-consumer.md
Updated navigation links (configuration path corrections), refined messaging descriptions (Broadcasting wording clarification), and replaced listener naming convention (Sequential → Concurrent). Minor formatting and best practices guidance adjustments.
Consumer Documentation (Chinese)
i18n/zh-CN/docusaurus-plugin-content-docs/current/consumer/message-filtering.md, i18n/zh-CN/.../consumer/overview.md, i18n/zh-CN/.../consumer/pull-consumer.md, i18n/zh-CN/.../consumer/push-consumer.md
Added comprehensive Chinese consumer guides covering Push/Pull consumer creation, configuration, subscription patterns (Tag and SQL92 filtering), message consumption models, offset management, error handling, and performance tuning with code examples and best practices.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 A carrot of code, a dependency shed,
Documentation blooms in red and in thread,
Chinese and English, side by side dance,
Consumer guides take their well-crafted stance,
From Push to Pull, filtering's grand,
RocketMQ's docs now beautifully planned! 🚀

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly relates to the main changes: completing consumer section parity between Chinese and English documentation and removing the chrono dependency.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 12

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@rocketmq-website/i18n/zh-CN/docusaurus-plugin-content-docs/current/consumer/message-filtering.md`:
- Around line 74-80: The example uses Message::new and calls put_property with
raw string literals, but put_property expects CheetahString values; update each
put_property call to convert keys and values using
CheetahString::from_static_str (e.g., replace message.put_property("amount",
"150.00") with message.put_property(CheetahString::from_static_str("amount"),
CheetahString::from_static_str("150.00")) for all property calls before
producer.send(message).await?).

In
`@rocketmq-website/i18n/zh-CN/docusaurus-plugin-content-docs/current/consumer/overview.md`:
- Around line 96-123: Replace the non-existent trait/enum usage: implement
either MessageListenerConcurrently or MessageListenerOrderly instead of
MessageListener; change the consume_message signature to accept the context
parameter and return a Result with the appropriate status enum (e.g.,
Result<ConsumeConcurrentlyStatus, Error> for concurrent or
Result<ConsumeOrderlyStatus, Error> for orderly) rather than returning the
status directly; use the correct status variants
(ConsumeConcurrentlyStatus::ConsumeSuccess / ::ReconsumeLater for concurrent;
ConsumeOrderlyStatus::Success / ::SuspendCurrentQueueAMoment / ::Rollback /
::Commit for orderly); update the impl block for consume_message, update calls
to process_message(&msg) to propagate/convert errors into the Result error, and
keep MessageExt and process_message names but ensure process_message returns
Result<(), Error> with a matching Error type used in the consume_message Result.
- Around line 222-231: The code example incorrectly calls commit_sync with
parameters and `?`; update the snippet to use the correct API: either show a
LitePullConsumer calling `commit_sync().await;` (and move the auto-commit
setting to the consumer builder rather than
`consumer_option.set_enable_auto_commit`) or demonstrate the map variant by
building a `HashMap<MessageQueue, i64>` and calling `commit_sync_with_map(map,
true).await;`; alternatively prefer the non-deprecated `commit().await` or
`commit_with_map(map).await` variants and remove any `?` error operator since
these methods do not return `Result`.
- Around line 129-143: Replace the nonexistent ConsumerOption example with the
real builder API: use DefaultMQPushConsumerBuilder and its fluent methods
instead of ConsumerOption and set_* methods; for example, call
DefaultMQPushConsumerBuilder::new() (or the crate's builder constructor) and
chain .name_server_addr(...), .consumer_group(...), .consume_thread_min(...),
.consume_thread_max(...), .pull_batch_size(...), and .pull_interval(...) to
configure the consumer options so the example compiles with the actual API.

In
`@rocketmq-website/i18n/zh-CN/docusaurus-plugin-content-docs/current/consumer/pull-consumer.md`:
- Around line 87-101: The example uses non-existent fields on PullResult; change
accesses to use result.msg_found_list (which is an
Option<Vec<ArcMut<MessageExt>>>) and handle it via match or if let Some(msgs) {
for msg in msgs { process_message(&msg); } } (or call the public getter if
provided), and treat result.next_begin_offset as a plain u64 (update
tracker.update(&queue, result.next_begin_offset) unconditionally) instead of
checking for Some(...); keep references to consumer.pull_from_offset,
tracker.update, and process_message when making these edits.
- Around line 28-64: The examples use non-existent methods pull(), pull_from(),
and pull_from_offset(); update them to the actual LitePullConsumer API: replace
pull(...) with poll() or poll_with_timeout(...) when fetching messages (refer to
consumer.poll or consumer.poll_with_timeout), replace
fetch_subscribe_message_queues(...) and pull_from(...) usage with
fetch_message_queues() and iterate those MessageQueue entries (refer to
consumer.fetch_message_queues), and replace pull_from_offset(...) with the seek
API (consumer.seek(), consumer.seek_to_begin(), or consumer.seek_to_end()) to
position offsets before calling poll/poll_with_timeout; ensure the code examples
reference the LitePullConsumer trait methods and the same consumer/MessageQueue
symbols used in the doc.
- Around line 205-226: The example uses a non-existent PullError enum and a
wrong variant name; change the error match arms to use the real enum and
variants from the codebase (use PullStatus::NoNewMsg instead of NoNewMessage and
PullStatus::OffsetIllegal instead of referencing PullError), i.e. update the
match on consumer.pull(...).await to handle Err(PullStatus::NoNewMsg) and
Err(PullStatus::OffsetIllegal) (and adjust any necessary imports or
fully-qualify PullStatus) so the example compiles against the current API.
- Around line 12-22: The docs show non-existent APIs PullConsumer::new and
rocketmq::conf::ConsumerOption; update the example to use the actual
builder-based API (DefaultLitePullConsumer and its builder) that exists in the
codebase. Replace references to PullConsumer::new and ConsumerOption with
DefaultLitePullConsumer::builder() (or the crate's documented builder method),
setting name_server_addr and group_name via the builder, then call build() and
start()/await as per the real API; ensure the example imports
DefaultLitePullConsumer and uses the correct builder method names from the
implementation.

In
`@rocketmq-website/i18n/zh-CN/docusaurus-plugin-content-docs/current/consumer/push-consumer.md`:
- Around line 57-75: The MessageListenerOrderly implementation signature is
incorrect: update the impl of MessageListenerOrderly for OrderListener so its
consume_message method matches the trait: fn consume_message(&self, msgs:
&[&MessageExt], context: &mut ConsumeOrderlyContext) ->
RocketMQResult<ConsumeOrderlyStatus>; process messages using msgs (the slice of
references) and return an Ok(ConsumeOrderlyStatus::Success) or other
ConsumeOrderlyStatus variant as appropriate; ensure you import/use
RocketMQResult and ConsumeOrderlyStatus and wrap the status in Ok() when
returning from consume_message.
- Around line 128-133: The example calls to consumer.suspend() and
consumer.resume() use async methods without awaiting; update the snippet to
await both async functions by calling consumer.suspend().await and
consumer.resume().await so the code compiles and correctly awaits the async fn
implementations of suspend and resume on PushConsumer.
- Around line 151-156: The examples use nonexistent methods seek_by_timestamp
and seek_to_offset on PushConsumer; remove or correct them by either deleting
these two example lines or switching the snippet to use LitePullConsumer (e.g.,
create a LitePullConsumer and call its seek(), seek_to_begin(), or seek_to_end()
methods) instead; update any surrounding text to reference PushConsumer has no
seek and that seek methods live on LitePullConsumer (symbols: PushConsumer,
LitePullConsumer, seek_by_timestamp, seek_to_offset, seek, seek_to_begin,
seek_to_end).
- Around line 32-50: The documentation example implements
MessageListenerConcurrently with the wrong consume_message signature; update
MyListener::consume_message to match the trait: change the parameters to (
&self, msgs: &[&MessageExt], context: &ConsumeConcurrentlyContext ) and change
the return type to rocketmq_error::RocketMQResult<ConsumeConcurrentlyStatus>;
inside the method iterate over msgs (e.g., for msg in msgs { ... }) and return
Ok(ConsumeConcurrentlyStatus::ConsumeSuccess) (or the appropriate status) so the
example compiles against the real trait.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 596d1952-e5b1-4a50-99ed-d6f85d11788d

📥 Commits

Reviewing files that changed from the base of the PR and between 8c3b1cc and d8f1262.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (9)
  • rocketmq-controller/Cargo.toml
  • rocketmq-website/docs/consumer/message-filtering.md
  • rocketmq-website/docs/consumer/overview.md
  • rocketmq-website/docs/consumer/pull-consumer.md
  • rocketmq-website/docs/consumer/push-consumer.md
  • rocketmq-website/i18n/zh-CN/docusaurus-plugin-content-docs/current/consumer/message-filtering.md
  • rocketmq-website/i18n/zh-CN/docusaurus-plugin-content-docs/current/consumer/overview.md
  • rocketmq-website/i18n/zh-CN/docusaurus-plugin-content-docs/current/consumer/pull-consumer.md
  • rocketmq-website/i18n/zh-CN/docusaurus-plugin-content-docs/current/consumer/push-consumer.md
💤 Files with no reviewable changes (1)
  • rocketmq-controller/Cargo.toml

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 55.39%. Comparing base (8c3b1cc) to head (d8f1262).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7033      +/-   ##
==========================================
- Coverage   55.41%   55.39%   -0.02%     
==========================================
  Files        1061     1061              
  Lines      174383   174383              
==========================================
- Hits        96630    96608      -22     
- Misses      77753    77775      +22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

AI review first Ai review pr first auto merge Difficulty level/Easy Easy ISSUE documentation📝 Improvements or additions to documentation ready to review waiting-review waiting review this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants