-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE #1828]🚀Implement MQClientAPIImpl#ackMessageAsync #1837
Conversation
WalkthroughThis pull request introduces enhancements to the RocketMQ client's error handling and message acknowledgment mechanisms. The changes include adding a new Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
🔊@mxsm 🚀Thanks for your contribution 🎉. CodeRabbit(AI) will review your code first 🔥 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
rocketmq-client/src/consumer/consumer_impl/default_mq_push_consumer_impl.rs (1)
Line range hint
1436-1476
: Potential enhancement: improved error handling & retries for ack failuresThe asynchronous acknowledgment code introduces an inline DefaultAckCallback. While it works well, consider implementing a retry or fallback if acknowledgment fails. Depending on the system requirements, repeatedly failing to acknowledge might be disruptive. For instance, you could offer an exponential backoff or mark the message for manual reprocessing. These changes can improve reliability and resilience.
rocketmq-client/src/implementation/mq_client_api_impl.rs (1)
1711-1753
: Robustness note: ack_message_async_innerThe internal method handles both single and batch acknowledgments. Consider logging additional details (e.g., acked message IDs, batch sizes) on success for easier traceability. This can greatly help in production debugging and analytics.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
rocketmq-client/src/client_error.rs
(1 hunks)rocketmq-client/src/consumer/consumer_impl/default_mq_push_consumer_impl.rs
(4 hunks)rocketmq-client/src/implementation/mq_client_api_impl.rs
(3 hunks)
🔇 Additional comments (6)
rocketmq-client/src/consumer/consumer_impl/default_mq_push_consumer_impl.rs (2)
19-19
: Minor observation on importing std::error::Error
Good addition if you plan to handle error trait objects within your consumer logic. Just ensure that any potential error objects conform to this trait for consistent error handling.
67-67
: Import for AckResult looks good
Bringing in AckResult clearly indicates the consumer logic will respond to or handle acknowledgment outcomes. The usage appears aligned with the newly introduced callback mechanism.
rocketmq-client/src/implementation/mq_client_api_impl.rs (3)
45-45
: New import for BatchAckMessageRequestBody
This import is used to handle batch acknowledgments. No immediate issues, but be sure to validate request-body construction for correct message sets.
54-54
: New import for AckMessageRequestHeader
This import supports single-message acknowledgments. Ensure that all fields in the header are properly set before sending the request to the broker.
1693-1709
: Check completeness of ack_message_async usage
The new public method ack_message_async looks well-structured. Verify that all calling sites handle both success and failure paths from the callback. If partial or conditional acknowledgments are ever needed, consider exposing more fine-grained statuses.
rocketmq-client/src/client_error.rs (1)
44-46
: CommonError variant addition
Introducing a CommonError variant broadens the scope of error handling. The implementation is clean and consistent with the rest of your error types, so this should simplify bridging errors from rocketmq_common.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1837 +/- ##
==========================================
- Coverage 28.40% 28.38% -0.03%
==========================================
Files 475 475
Lines 66006 66071 +65
==========================================
Hits 18752 18752
- Misses 47254 47319 +65 ☔ View full report in Codecov by Sentry. |
Which Issue(s) This PR Fixes(Closes)
Fixes #1828
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
New Features
CommonError
for improved error handling.Bug Fixes
Documentation