Skip to content

[ISSUE #9334]♻️Inject remoting command factories into proxy remoting owners - #9338

Merged
mxsm merged 1 commit into
mainfrom
mxsm/inject-proxy-remoting-command-factory
Aug 13, 2026
Merged

[ISSUE #9334]♻️Inject remoting command factories into proxy remoting owners#9338
mxsm merged 1 commit into
mainfrom
mxsm/inject-proxy-remoting-command-factory

Conversation

@mxsm

@mxsm mxsm commented Aug 13, 2026

Copy link
Copy Markdown
Owner

Which Issue(s) This PR Fixes(Closes)

Brief Description

  • Give proxy remoting request processors and dispatchers one immutable, owner-scoped RemotingCommandFactory.
  • Route all production success, error, typed-header, heartbeat, drain-management, and authorization responses through the owning factory.
  • Preserve existing constructors and server helpers as application-default compatibility paths.
  • Export explicit factory-aware constructors and server composition helpers for embedded owners.
  • Inject the application factory explicitly from the proxy bootstrap boundary.

The response code, remark, body, custom header, opaque value, flags, authorization behavior, drain behavior, and backend passthrough behavior remain unchanged. The only selectable difference is the owner-provided remoting version and serialization type.

How Did You Test This Change?

  • cargo test -p rocketmq-proxy dispatcher_responses_keep_independent_owner_defaults --lib --all-features
  • cargo test -p rocketmq-proxy --lib --all-features (96 passed)
  • Proxy binary tests (6 passed)
  • cargo test -p rocketmq-proxy --test grpc_ingress --all-features (9 passed)
  • cargo test -p rocketmq-proxy --test remoting_ingress --all-features (3 passed)
  • cargo test -p rocketmq-proxy --test proxy_runtime_scope_compile_fail --all-features (1 passed)
  • cargo check -p rocketmq-proxy --no-default-features --features local-mode
  • cargo check -p rocketmq-proxy --no-default-features --features cluster-mode
  • cargo clippy -p rocketmq-proxy --no-deps --all-targets --all-features -- -D warnings
  • cargo clippy --workspace --no-deps --all-targets --all-features -- -D warnings
  • cargo doc -p rocketmq-proxy --no-deps --all-features
  • Package-by-package format checks for all 28 root workspace packages
  • git diff --check

The aggregate Windows cargo fmt --all -- --check invocation still reaches OS error 206 because of the workspace command length. Every root workspace package passed its equivalent non-mutating format check individually.

proxy_feature_closure::local_mode_excludes_cluster_client_dependencies reports that the local-only closure contains rocketmq-client-rust. The same focused command fails on the unmodified main commit with the same assertion; this PR does not change manifests or dependency features. The other closure assertion passes.

Summary by CodeRabbit

  • New Features

    • Added support for configurable remoting response defaults, including protocol version and serialization type.
    • Ensured responses consistently preserve the selected remoting configuration across proxy operations.
    • Added public server startup options for custom remoting command handling.
  • Compatibility

    • Existing startup and request-processing behavior remains available with the default configuration.
  • Tests

    • Added coverage verifying that custom remoting configurations are applied independently.

@mxsm
mxsm merged commit b3a866d into main Aug 13, 2026
8 of 13 checks passed
@mxsm
mxsm deleted the mxsm/inject-proxy-remoting-command-factory branch August 13, 2026 08:14
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b798560b-5819-4669-a9f8-cc1738f10935

📥 Commits

Reviewing files that changed from the base of the PR and between b884e02 and 312482f.

📒 Files selected for processing (3)
  • rocketmq-proxy/src/bootstrap.rs
  • rocketmq-proxy/src/lib.rs
  • rocketmq-proxy/src/remoting.rs

Walkthrough

Proxy remoting now injects RemotingCommandFactory instances through server startup, request processing, dispatch, authentication, drain handling, handlers, and response helpers. Existing APIs retain application-default behavior. Tests verify independent response defaults.

Changes

Proxy remoting factory injection

Layer / File(s) Summary
Factory ownership and constructors
rocketmq-proxy/src/remoting.rs
ProxyRequestProcessor and ProxyRemotingDispatcher retain configurable command factories. Existing constructors delegate to application-default variants.
Factory-aware server startup
rocketmq-proxy/src/remoting.rs, rocketmq-proxy/src/lib.rs, rocketmq-proxy/src/bootstrap.rs
Startup paths accept and propagate command factories alongside service context, readiness callbacks, and drain controllers. Public re-exports expose the new entry points.
Factory-backed response construction
rocketmq-proxy/src/remoting.rs
Authentication, drain, handler, backend-error, and response-helper paths create commands through the configured factory.
Custom factory validation
rocketmq-proxy/src/remoting.rs
Tests verify that JSON and RocketMQ dispatchers preserve independent configured protocol versions and serialization types.

Estimated code review effort: 4 (Complex) | ~45 minutes

Possibly related PRs

Suggested labels: refactor♻️, approved, auto merge, AI review first

Suggested reviewers: rocketmq-rust-bot, spacexcn, teslarustor

Poem

A rabbit wires each command with care,
Factory defaults travel everywhere.
Success and errors share the tune,
JSON and RocketMQ under one moon.
Tests hop softly: the defaults stay true.

✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mxsm/inject-proxy-remoting-command-factory

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.

@rocketmq-rust-bot

Copy link
Copy Markdown
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💥.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Refactor♻️] Inject remoting command factories into proxy remoting owners

3 participants