[ISSUE #1666]🚀Implement MQClientAPIImpl#changeInvisibleTimeAsync method logic🔥#1669
[ISSUE #1666]🚀Implement MQClientAPIImpl#changeInvisibleTimeAsync method logic🔥#1669rocketmq-rust-bot merged 1 commit intomainfrom
Conversation
WalkthroughThe changes in this pull request involve modifications to several files within the RocketMQ client and remoting modules. The Changes
Assessment against linked issues
Possibly related PRs
Suggested labels
Suggested reviewers
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 🔥 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1669 +/- ##
==========================================
- Coverage 27.64% 27.63% -0.02%
==========================================
Files 470 470
Lines 62858 62895 +37
==========================================
Hits 17380 17380
- Misses 45478 45515 +37 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (1)
rocketmq-client/src/implementation/mq_client_api_impl.rs (1)
1365-1365: Remove commented-out code or implement the 'extra_info' field in 'AckResult'The
extra_infofield assignment is currently commented out. If this field is necessary for providing additional context in the acknowledgment result, please implement it. Otherwise, remove the commented code to maintain code cleanliness.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
📒 Files selected for processing (3)
rocketmq-client/src/consumer/ack_result.rs(1 hunks)rocketmq-client/src/implementation/mq_client_api_impl.rs(3 hunks)rocketmq-remoting/src/protocol/header.rs(1 hunks)
🔇 Additional comments (5)
rocketmq-client/src/implementation/mq_client_api_impl.rs (3)
51-52: Imported necessary modules for 'ChangeInvisibleTime' functionality
The imports of ChangeInvisibleTimeRequestHeader and ChangeInvisibleTimeResponseHeader are necessary for implementing the new change_invisible_time_async method.
93-96: Imported necessary modules for acknowledgment handling
These imports are required for handling acknowledgment callbacks and results in the new asynchronous method.
1380-1381: Verify if returning Ok(()) regardless of outcome is appropriate
The method returns Ok(()) even when there is an error during the operation (e.g., in the Err(e) case). Is this intentional? Consider returning the error instead of Ok(()) so that the caller can handle it appropriately.
rocketmq-remoting/src/protocol/header.rs (1)
19-19: Approved: Made change_invisible_time_response_header module public
Changing the visibility to pub allows the ChangeInvisibleTimeResponseHeader to be accessible from other modules, which is necessary for the new functionality in mq_client_api_impl.rs.
rocketmq-client/src/consumer/ack_result.rs (1)
21-21: Approved: Derived Default trait for AckResult
Deriving Default for AckResult enables default instantiation of the struct, which is beneficial when default values are acceptable for its fields.
| let ack_result = if ResponseCode::from(response.code()) == ResponseCode::Success { | ||
| AckResult { | ||
| status: AckStatus::Ok, | ||
| pop_time: header.pop_time as i64, | ||
| // extra_info: ExtraInfoUtil::build_extra_info(request), | ||
| ..Default::default() | ||
| } | ||
| } else { | ||
| AckResult { | ||
| status: AckStatus::NotExist, | ||
| ..Default::default() | ||
| } | ||
| }; |
There was a problem hiding this comment.
🛠️ Refactor suggestion
Consider handling different response codes explicitly
Currently, when the response code is not ResponseCode::Success, the AckResult status is set to AckStatus::NotExist. There may be other response codes that should be handled differently. Consider matching on response.code() to handle different cases and set the AckResult.status accordingly to provide more accurate feedback to the caller.
Which Issue(s) This PR Fixes(Closes)
Fixes #1666
Brief Description
How Did You Test This Change?
Summary by CodeRabbit
change_invisible_time_response_headermodule to public, allowing external access.