Skip to content

[ISSUE #6341]🚀Add producer send with selector examples#6342

Merged
mxsm merged 2 commits intomainfrom
feat-6341
Feb 15, 2026
Merged

[ISSUE #6341]🚀Add producer send with selector examples#6342
mxsm merged 2 commits intomainfrom
feat-6341

Conversation

@mxsm
Copy link
Owner

@mxsm mxsm commented Feb 15, 2026

Which Issue(s) This PR Fixes(Closes)

Brief Description

How Did You Test This Change?

Summary by CodeRabbit

  • New Features
    • Added a new producer example demonstrating message sending with custom queue selectors, covering five use cases: standard selector, selector with timeout, selector with callback, selector with callback and timeout, and one-way send with selector.

@rocketmq-rust-bot
Copy link
Collaborator

🔊@mxsm 🚀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-robot rocketmq-rust-robot added the feature🚀 Suggest an idea for this project. label Feb 15, 2026
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 15, 2026

Walkthrough

This pull request adds a new RocketMQ producer example demonstrating message sending with custom queue selectors. It includes updates to the manifest file to register the example and a new example implementation file showcasing five send scenarios with queue selection.

Changes

Cohort / File(s) Summary
Build Configuration
rocketmq-example/Cargo.toml
Added new example entry "producer-send-with-selector" pointing to examples/producer/send_with_selector.rs.
Producer Example Implementation
rocketmq-example/examples/producer/send_with_selector.rs
New example demonstrating producer message sending with queue selectors across five scenarios: standard selector, selector with timeout, selector with callback, selector with callback and timeout, and one-way send. Includes public constants for configuration (producer group, name server, topic, tag, timeout) and async main function with producer initialization, sequential demo execution, and shutdown logic.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰✨ A selector so fine, queues aligned in a row,
Examples now shine, where messages flow,
With callbacks and timeouts, the patterns take flight,
New docs for producers—RocketMQ's bright! 🚀

🚥 Pre-merge checks | ✅ 6
✅ Passed checks (6 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly references issue #6341 and accurately describes the main change: adding producer send with selector examples.
Linked Issues check ✅ Passed The PR implements the feature to add producer send with selector examples as indicated by issue #6341, with multiple selector scenarios demonstrated.
Out of Scope Changes check ✅ Passed All changes are directly related to the PR objective of adding producer send with selector examples; no out-of-scope modifications detected.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Merge Conflict Detection ✅ Passed ✅ No merge conflicts detected when merging into main

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-6341

No actionable comments were generated in the recent review. 🎉

🧹 Recent nitpick comments
rocketmq-example/examples/producer/send_with_selector.rs (2)

85-94: Consider varying the selector strategy across examples to better showcase the feature.

Every scenario uses the identical queues.first().cloned() selector. Using different strategies (e.g., hash-based, round-robin, random) in different scenarios would make the example more instructive — the comments on lines 90-93 already list good candidates.


164-170: Duplicate callback closures could be extracted into a shared helper.

The callback definitions at lines 164-170 and 203-209 are identical. For an example file this is acceptable for self-contained readability, but extracting a helper (e.g., fn make_callback() -> SendMessageCallback) would reduce repetition if more scenarios are added later.

Also applies to: 203-209


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
Collaborator

@rocketmq-rust-bot rocketmq-rust-bot left a comment

Choose a reason for hiding this comment

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

LGTM - All CI checks passed ✅

@mxsm mxsm merged commit 511417d into main Feb 15, 2026
16 checks passed
@rocketmq-rust-bot rocketmq-rust-bot added approved PR has approved and removed ready to review waiting-review waiting review this PR labels Feb 15, 2026
@mxsm mxsm deleted the feat-6341 branch February 22, 2026 05:26
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 approved PR has approved auto merge feature🚀 Suggest an idea for this project.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature🚀] Add producer send with selector examples

3 participants