Skip to content

Conversation

@LED-0102
Copy link
Contributor

@LED-0102 LED-0102 commented Jan 7, 2026

Which Issue(s) This PR Fixes(Closes)

Fixes #5527

Brief Description

This PR updates the default controller listen address to use port 60109 instead of the previously hardcoded port.

The change has been applied consistently across:

  • ControllerConfig default configuration
  • ControllerConfig::new_node
  • Controller example files

Please let me know if updating these locations is sufficient, or if there are additional places where this port should be updated.

How Did You Test This Change?

  • Built the project using cargo build
  • Ran all tests using cargo test --all-features --workspace

Summary by CodeRabbit

  • Chores
    • Updated the default controller listen port from 9876 to 60109 in configuration and example files.

✏️ Tip: You can customize this high-level summary in your review settings.

@rocketmq-rust-bot
Copy link
Collaborator

🔊@LED-0102 🚀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💥.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 7, 2026

Walkthrough

Updates the default controller listen address port from 9876 to 60109 across configuration files and examples. The changes include the core controller configuration, test helpers, integration examples, and documentation, with no logic or API modifications.

Changes

Cohort / File(s) Summary
Controller Configuration
rocketmq-common/src/common/controller/controller_config.rs
Updated default listen address from 127.0.0.1:9876 to 127.0.0.1:60109 in ControllerConfig::default and test helper function
Examples
rocketmq-controller/examples/controller_metrics_example.rs, rocketmq-controller/examples/single_node.rs
Updated example configurations to use port 60109 instead of 9876 for node/controller listen address
Documentation
CHANGELOG.md
Added entry under Unreleased > Changed documenting the controller default listen address port update

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Hops with glee at port sixty-one-oh-nine,
A new address where controllers align,
From nine-eight-seven-six, we make the leap,
Configuration changes, simple and sweet! 🚀

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the main change: updating the default controller listen port to 60109, which matches the primary objective of the PR.
Linked Issues check ✅ Passed The PR successfully implements the coding requirements from issue #5527 by updating the controller configuration to use port 60109 across all relevant files.
Out of Scope Changes check ✅ Passed All changes are strictly scoped to updating the controller listen port from 9876 to 60109 in configuration and example files, with no unrelated modifications.

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

✨ Finishing touches
  • 📝 Generate docstrings

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

🤖 Fix all issues with AI agents
In @rocketmq-common/src/common/controller/controller_config.rs:
- Line 244: Update all hardcoded loopback addresses that still use
"127.0.0.1:9876" to the new default "127.0.0.1:60109" so they match the
listen_addr default in controller_config.rs (where listen_addr is set to
"127.0.0.1:60109".parse().unwrap()). Search for the literal "127.0.0.1:9876" in
tests and examples (including the listed test functions,
openraft_integration_test, three_node_cluster example, and the modules using
transport/replica/replicas_info_manager) and replace each occurrence with
"127.0.0.1:60109"; ensure any assertions or expected addresses are updated
accordingly and run tests to verify no remaining hardcoded 9876 usages remain.
🧹 Nitpick comments (1)
CHANGELOG.md (1)

25-25: LGTM! Consider emphasizing the breaking change nature.

The CHANGELOG entry correctly documents the port change. However, since changing the default port is a breaking change that may affect existing deployments, consider making this more explicit, for example:

-- **chore(controller):** Update default controller listen address to use port 60109 ([#5527](https://github.com/mxsm/rocketmq-rust/issues/5527))
+- **chore(controller):** Update default controller listen address to use port 60109 (BREAKING CHANGE: affects new deployments using default configuration) ([#5527](https://github.com/mxsm/rocketmq-rust/issues/5527))
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d37420f and 0a126f2.

📒 Files selected for processing (4)
  • CHANGELOG.md
  • rocketmq-common/src/common/controller/controller_config.rs
  • rocketmq-controller/examples/controller_metrics_example.rs
  • rocketmq-controller/examples/single_node.rs
🧰 Additional context used
🧬 Code graph analysis (1)
rocketmq-controller/examples/controller_metrics_example.rs (1)
rocketmq-common/src/common/controller/controller_config.rs (2)
  • new (257-259)
  • new_node (415-417)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: auto-approve
🔇 Additional comments (3)
rocketmq-common/src/common/controller/controller_config.rs (1)

421-421: LGTM! Test helper updated consistently.

The test configuration helper correctly uses the new default port 60109, maintaining consistency with the main default implementation.

rocketmq-controller/examples/controller_metrics_example.rs (1)

40-40: LGTM! Example updated to reflect new default port.

The example correctly demonstrates the new default controller port 60109, consistent with the updated ControllerConfig defaults.

rocketmq-controller/examples/single_node.rs (1)

43-43: LGTM! Example updated consistently.

The single-node example correctly uses the new default port 60109, maintaining consistency across all configuration files and examples.

config_black_list: "configBlackList;configStorePath".to_string(),
node_id: 1,
listen_addr: "127.0.0.1:9876".parse().unwrap(),
listen_addr: "127.0.0.1:60109".parse().unwrap(),
Copy link
Contributor

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for remaining references to port 9876
echo "=== Searching for port 9876 references ==="
rg -n "9876" --type rust -C 2

echo -e "\n=== Searching for old listen address pattern ==="
rg -n "127\.0\.0\.1:9876" -C 2

echo -e "\n=== Searching for port 60109 references to confirm updates ==="
rg -n "60109" --type rust -C 2

Repository: mxsm/rocketmq-rust

Length of output: 50377


🏁 Script executed:

# Read the controller_config.rs file around line 244
cat -n rocketmq-common/src/common/controller/controller_config.rs | sed -n '235,255p'

# Find all config files with default port/listen_addr settings
echo -e "\n=== Searching for listen_addr defaults in config files ==="
rg -n "listen_addr.*:" --type rust rocketmq-common/src/common/controller/ -C 1

# Check if there are other default listen_addr patterns in controller configs
echo -e "\n=== Checking for other port defaults in controller modules ==="
rg -n "default.*addr\|listen.*default\|port.*default" --type rust rocketmq-common/src/common/controller/ -i

Repository: mxsm/rocketmq-rust

Length of output: 2538


🏁 Script executed:

# Search specifically for the address pattern 127.0.0.1:9876
echo "=== Direct port 9876 address references ==="
rg "127\.0\.0\.1:9876" --type rust

# Check if those references are in test code
echo -e "\n=== Checking context of consumer_connection.rs reference ==="
rg -B 3 -A 3 "127\.0\.0\.1:9876" rocketmq-remoting/src/protocol/body/consumer_connection.rs

echo -e "\n=== Checking context of get_meta_data_response_header.rs references ==="
rg -B 3 -A 3 "127\.0\.0\.1:9876" rocketmq-remoting/src/protocol/header/get_meta_data_response_header.rs

Repository: mxsm/rocketmq-rust

Length of output: 14472


🏁 Script executed:

# Check the controller test files
echo "=== Checking metrics_quick_reference_test.rs ==="
cat -n rocketmq-controller/tests/metrics_quick_reference_test.rs | head -30

echo -e "\n=== Checking three_node_cluster.rs example ==="
cat -n rocketmq-controller/examples/three_node_cluster.rs | head -50 | tail -30

Repository: mxsm/rocketmq-rust

Length of output: 2552


🏁 Script executed:

# Check more of the three_node_cluster example to see the node configurations
echo "=== Checking three_node_cluster.rs node address configuration ==="
rg -A 5 "BTreeMap" rocketmq-controller/examples/three_node_cluster.rs | head -40

# Count how many test/example files still hardcode 9876 for controller
echo -e "\n=== Files in rocketmq-controller using 127.0.0.1:9876 ==="
rg -l "127\.0\.0\.1:9876" rocketmq-controller/

Repository: mxsm/rocketmq-rust

Length of output: 843


🏁 Script executed:

# Check the context in the controller test files - are they intentional test mocks or should they use the new default?
echo "=== Context from metrics_quick_reference_test.rs (all lines with 9876) ==="
rg -B 2 -A 2 "127\.0\.0\.1:9876" rocketmq-controller/tests/metrics_quick_reference_test.rs | head -40

echo -e "\n=== Context from openraft_integration_test.rs (first occurrence) ==="
rg -B 3 -A 3 "127\.0\.0\.1:9876" rocketmq-controller/tests/openraft_integration_test.rs | head -15

Repository: mxsm/rocketmq-rust

Length of output: 2100


Update controller test and example files to use port 60109 for consistency with the new default.

While the default listen_addr in controller_config.rs has been correctly updated to port 60109, multiple test and example files in rocketmq-controller still hardcode "127.0.0.1:9876":

  • rocketmq-controller/tests/metrics_quick_reference_test.rs (9 test functions)
  • rocketmq-controller/tests/openraft_integration_test.rs
  • rocketmq-controller/examples/three_node_cluster.rs
  • rocketmq-controller/src/raft/transport.rs
  • rocketmq-controller/src/metadata/replica.rs
  • rocketmq-controller/src/manager/replicas_info_manager.rs

These should be updated to "127.0.0.1:60109" to maintain consistency with the new default port.

🤖 Prompt for AI Agents
In @rocketmq-common/src/common/controller/controller_config.rs at line 244,
Update all hardcoded loopback addresses that still use "127.0.0.1:9876" to the
new default "127.0.0.1:60109" so they match the listen_addr default in
controller_config.rs (where listen_addr is set to
"127.0.0.1:60109".parse().unwrap()). Search for the literal "127.0.0.1:9876" in
tests and examples (including the listed test functions,
openraft_integration_test, three_node_cluster example, and the modules using
transport/replica/replicas_info_manager) and replace each occurrence with
"127.0.0.1:60109"; ensure any assertions or expected addresses are updated
accordingly and run tests to verify no remaining hardcoded 9876 usages remain.

@codecov
Copy link

codecov bot commented Jan 7, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 38.41%. Comparing base (d37420f) to head (0a126f2).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5530      +/-   ##
==========================================
- Coverage   38.41%   38.41%   -0.01%     
==========================================
  Files         815      815              
  Lines      110512   110512              
==========================================
- Hits        42452    42450       -2     
- Misses      68060    68062       +2     

☔ 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.

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 ✅

Copy link
Owner

@mxsm mxsm left a comment

Choose a reason for hiding this comment

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

@LED-0102 Thanks for your contribution, LGTM

@mxsm mxsm merged commit d2768cf into mxsm:main Jan 7, 2026
12 of 22 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 Jan 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Enhancement✨] Update listen address in controller configuration to use port 60109

4 participants