Skip to content

[ISSUE ##748]🔥Implement message arrival notification for consumers🎨#749

Merged
mxsm merged 1 commit intomainfrom
feature-748
Jul 9, 2024
Merged

[ISSUE ##748]🔥Implement message arrival notification for consumers🎨#749
mxsm merged 1 commit intomainfrom
feature-748

Conversation

@mxsm
Copy link
Copy Markdown
Owner

@mxsm mxsm commented Jul 9, 2024

Which Issue(s) This PR Fixes(Closes)

Fixes #748

Brief Description

How Did You Test This Change?

Summary by CodeRabbit

  • New Features

    • Improved message processing in multi-queue scenarios within the ReputMessageService.
  • Refactor

    • Rearranged the initialization order in start_basic_service for better performance and reliability.
    • Enhanced the structure of ReputMessageService to improve code maintainability and performance.
  • Bug Fixes

    • Removed unnecessary logging statement to clean up log output.

@github-actions github-actions bot requested review from SpaceXCN and TeslaRustor July 9, 2024 09:11
@mxsm
Copy link
Copy Markdown
Owner Author

mxsm commented Jul 9, 2024

🚀Thanks for your contribution🎉. CodeRabbit(AI) will review your code first🔥

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 9, 2024

Walkthrough

The updates to RocketMQ include several refinements such as reordering initializer logic in BrokerRuntime, removal of an unnecessary log statement in DefaultPullMessageResultHandler, and enhancements to the ReputMessageService for handling message arrival notifications for multiple queues. These changes contribute to smoother operations and more efficient processing within the RocketMQ broker and store components.

Changes

Files Change Summary
rocketmq-broker/src/broker_runtime.rs Rearranged initialization of request_processor and fast_request_processor in start_basic_service method.
rocketmq-broker/src/processor/default_pull_message_result_handler.rs Removed the info! log statement under the ResponseCode::Success case.
rockemq-store/src/message_store/default_message_store.rs Updated ReputMessageService to handle message_store_config, additional fields, and utilized Arc for shared message store. New ReputMessageServiceInner struct included.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant BrokerRuntime
    participant Server
    participant RequestProcessor

    Client ->> BrokerRuntime: Call start_basic_service()
    BrokerRuntime ->> Server: Create Server
    BrokerRuntime ->> RequestProcessor: Init request_processor
    BrokerRuntime ->> RequestProcessor: Clone fast_request_processor
    BrokerRuntime ->>+ Server: Start server (tokio::spawn)
    BrokerRuntime -->>- Server: Running...
Loading

Assessment against linked issues

Objective Addressed Explanation
Implement message arrival notification for consumers (#748)

Poem

In code so swift, changes breeze,
Fixes flow like gentle seas.
Brokers start, now more precise,
Consumers get their much due slice.
Logs trimmed down, configs made neat,
RocketMQ's rhythm takes its beat. 🚀🐇


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?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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 as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link
Copy Markdown

codecov bot commented Jul 9, 2024

Codecov Report

Attention: Patch coverage is 0% with 37 lines in your changes missing coverage. Please review.

Project coverage is 27.71%. Comparing base (b7f1fbb) to head (ec008e0).

Files Patch % Lines
...q-store/src/message_store/default_message_store.rs 0.00% 35 Missing ⚠️
rocketmq-broker/src/broker_runtime.rs 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #749      +/-   ##
==========================================
- Coverage   27.75%   27.71%   -0.04%     
==========================================
  Files         271      271              
  Lines       21487    21526      +39     
==========================================
+ Hits         5963     5966       +3     
- Misses      15524    15560      +36     

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

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: 0

Outside diff range and nitpick comments (1)
rocketmq-broker/src/broker_runtime.rs (1)

602-602: Typo in comment.

Correct the typo in the comment: "start nomarl broker server".

- //start nomarl broker server
+ //start normal broker server
Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b7f1fbb and ec008e0.

Files selected for processing (3)
  • rocketmq-broker/src/broker_runtime.rs (1 hunks)
  • rocketmq-broker/src/processor/default_pull_message_result_handler.rs (1 hunks)
  • rocketmq-store/src/message_store/default_message_store.rs (4 hunks)
Files skipped from review due to trivial changes (1)
  • rocketmq-broker/src/processor/default_pull_message_result_handler.rs
Additional context used
GitHub Check: codecov/patch
rocketmq-broker/src/broker_runtime.rs

[warning] 593-594: rocketmq-broker/src/broker_runtime.rs#L593-L594
Added lines #L593 - L594 were not covered by tests

rocketmq-store/src/message_store/default_message_store.rs

[warning] 225-226: rocketmq-store/src/message_store/default_message_store.rs#L225-L226
Added lines #L225 - L226 were not covered by tests


[warning] 1068-1069: rocketmq-store/src/message_store/default_message_store.rs#L1068-L1069
Added lines #L1068 - L1069 were not covered by tests


[warning] 1074-1075: rocketmq-store/src/message_store/default_message_store.rs#L1074-L1075
Added lines #L1074 - L1075 were not covered by tests


[warning] 1082-1088: rocketmq-store/src/message_store/default_message_store.rs#L1082-L1088
Added lines #L1082 - L1088 were not covered by tests


[warning] 1092-1092: rocketmq-store/src/message_store/default_message_store.rs#L1092
Added line #L1092 was not covered by tests


[warning] 1096-1096: rocketmq-store/src/message_store/default_message_store.rs#L1096
Added line #L1096 was not covered by tests


[warning] 1100-1100: rocketmq-store/src/message_store/default_message_store.rs#L1100
Added line #L1100 was not covered by tests


[warning] 1103-1109: rocketmq-store/src/message_store/default_message_store.rs#L1103-L1109
Added lines #L1103 - L1109 were not covered by tests


[warning] 1111-1111: rocketmq-store/src/message_store/default_message_store.rs#L1111
Added line #L1111 was not covered by tests


[warning] 1118-1124: rocketmq-store/src/message_store/default_message_store.rs#L1118-L1124
Added lines #L1118 - L1124 were not covered by tests


[warning] 1146-1146: rocketmq-store/src/message_store/default_message_store.rs#L1146
Added line #L1146 was not covered by tests


[warning] 1148-1148: rocketmq-store/src/message_store/default_message_store.rs#L1148
Added line #L1148 was not covered by tests


[warning] 1202-1202: rocketmq-store/src/message_store/default_message_store.rs#L1202
Added line #L1202 was not covered by tests


[warning] 1209-1209: rocketmq-store/src/message_store/default_message_store.rs#L1209
Added line #L1209 was not covered by tests

Additional comments not posted (15)
rocketmq-broker/src/broker_runtime.rs (1)

593-594: Ensure test coverage for new lines.

The lines initializing request_processor and fast_request_processor are not covered by tests.

Consider adding tests to cover these lines and ensure they function as expected.

Tools
GitHub Check: codecov/patch

[warning] 593-594: rocketmq-broker/src/broker_runtime.rs#L593-L594
Added lines #L593 - L594 were not covered by tests

rocketmq-store/src/message_store/default_message_store.rs (14)

225-226: Ensure test coverage for new fields.

The message_store_config and inner fields are not covered by tests.

Consider adding tests to cover these fields and ensure they function as expected.

Tools
GitHub Check: codecov/patch

[warning] 225-226: rocketmq-store/src/message_store/default_message_store.rs#L225-L226
Added lines #L225 - L226 were not covered by tests


1068-1069: Ensure test coverage for new fields.

The message_store_config and inner fields are not covered by tests.

Consider adding tests to cover these fields and ensure they function as expected.

Tools
GitHub Check: codecov/patch

[warning] 1068-1069: rocketmq-store/src/message_store/default_message_store.rs#L1068-L1069
Added lines #L1068 - L1069 were not covered by tests


1074-1081: Ensure test coverage for new conditions.

The new conditions in the notify_message_arrive4multi_queue method are not covered by tests.

Consider adding tests to cover these conditions and ensure they function as expected.

Tools
GitHub Check: codecov/patch

[warning] 1074-1075: rocketmq-store/src/message_store/default_message_store.rs#L1074-L1075
Added lines #L1074 - L1075 were not covered by tests


1082-1088: Ensure test coverage for new conditions.

The new conditions in the notify_message_arrive4multi_queue method are not covered by tests.

Consider adding tests to cover these conditions and ensure they function as expected.

Tools
GitHub Check: codecov/patch

[warning] 1082-1088: rocketmq-store/src/message_store/default_message_store.rs#L1082-L1088
Added lines #L1082 - L1088 were not covered by tests


1092-1092: Ensure test coverage for new conditions.

The new conditions in the notify_message_arrive4multi_queue method are not covered by tests.

Consider adding tests to cover these conditions and ensure they function as expected.

Tools
GitHub Check: codecov/patch

[warning] 1092-1092: rocketmq-store/src/message_store/default_message_store.rs#L1092
Added line #L1092 was not covered by tests


1096-1096: Ensure test coverage for new conditions.

The new conditions in the notify_message_arrive4multi_queue method are not covered by tests.

Consider adding tests to cover these conditions and ensure they function as expected.

Tools
GitHub Check: codecov/patch

[warning] 1096-1096: rocketmq-store/src/message_store/default_message_store.rs#L1096
Added line #L1096 was not covered by tests


1100-1100: Ensure test coverage for new conditions.

The new conditions in the notify_message_arrive4multi_queue method are not covered by tests.

Consider adding tests to cover these conditions and ensure they function as expected.

Tools
GitHub Check: codecov/patch

[warning] 1100-1100: rocketmq-store/src/message_store/default_message_store.rs#L1100
Added line #L1100 was not covered by tests


1103-1109: Ensure test coverage for new conditions.

The new conditions in the notify_message_arrive4multi_queue method are not covered by tests.

Consider adding tests to cover these conditions and ensure they function as expected.

Tools
GitHub Check: codecov/patch

[warning] 1103-1109: rocketmq-store/src/message_store/default_message_store.rs#L1103-L1109
Added lines #L1103 - L1109 were not covered by tests


1111-1111: Ensure test coverage for new conditions.

The new conditions in the notify_message_arrive4multi_queue method are not covered by tests.

Consider adding tests to cover these conditions and ensure they function as expected.

Tools
GitHub Check: codecov/patch

[warning] 1111-1111: rocketmq-store/src/message_store/default_message_store.rs#L1111
Added line #L1111 was not covered by tests


1118-1124: Ensure test coverage for new conditions.

The new conditions in the notify_message_arrive4multi_queue method are not covered by tests.

Consider adding tests to cover these conditions and ensure they function as expected.

Tools
GitHub Check: codecov/patch

[warning] 1118-1124: rocketmq-store/src/message_store/default_message_store.rs#L1118-L1124
Added lines #L1118 - L1124 were not covered by tests


1146-1146: Ensure test coverage for new initialization.

The initialization of the inner field using an Arc is not covered by tests.

Consider adding tests to cover this initialization and ensure it functions as expected.

Tools
GitHub Check: codecov/patch

[warning] 1146-1146: rocketmq-store/src/message_store/default_message_store.rs#L1146
Added line #L1146 was not covered by tests


1148-1148: Ensure test coverage for new initialization.

The initialization of the inner field using an Arc is not covered by tests.

Consider adding tests to cover this initialization and ensure it functions as expected.

Tools
GitHub Check: codecov/patch

[warning] 1148-1148: rocketmq-store/src/message_store/default_message_store.rs#L1148
Added line #L1148 was not covered by tests


1202-1202: Ensure test coverage for new struct.

The ReputMessageServiceInner struct is not covered by tests.

Consider adding tests to cover this struct and ensure it functions as expected.

Tools
GitHub Check: codecov/patch

[warning] 1202-1202: rocketmq-store/src/message_store/default_message_store.rs#L1202
Added line #L1202 was not covered by tests


1209-1209: Ensure test coverage for new field.

The message_store field in the ReputMessageServiceInner struct is not covered by tests.

Consider adding tests to cover this field and ensure it functions as expected.

Tools
GitHub Check: codecov/patch

[warning] 1209-1209: rocketmq-store/src/message_store/default_message_store.rs#L1209
Added line #L1209 was not covered by tests

@TeslaRustor TeslaRustor added approved PR has approved and removed ready to review labels Jul 9, 2024
@mxsm mxsm merged commit e64c26d into main Jul 9, 2024
@mxsm mxsm deleted the feature-748 branch July 9, 2024 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved PR has approved auto merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature🚀] Implement message arrival notification for consumers

2 participants