weibocom/motan
A cross-language remote procedure call(RPC) framework for rapid development of high performance distributed services.
Slowing — last commit 6mo ago
weakest axisnon-standard license (Other); top contributor handles 93% of recent commits
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓Last commit 6mo ago
- ✓3 active contributors
- ✓Other licensed
Show all 9 evidence items →Show less
- ✓CI configured
- ✓Tests present
- ⚠Slowing — last commit 6mo ago
- ⚠Small team — 3 contributors active in recent commits
- ⚠Single-maintainer risk — top contributor 93% of recent commits
- ⚠Non-standard license (Other) — review terms
What would change the summary?
- →Use as dependency Concerns → Mixed if: clarify license terms
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Forkable" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/weibocom/motan)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/weibocom/motan on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: weibocom/motan
Generated by RepoPilot · 2026-05-09 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/weibocom/motan shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
WAIT — Slowing — last commit 6mo ago
- Last commit 6mo ago
- 3 active contributors
- Other licensed
- CI configured
- Tests present
- ⚠ Slowing — last commit 6mo ago
- ⚠ Small team — 3 contributors active in recent commits
- ⚠ Single-maintainer risk — top contributor 93% of recent commits
- ⚠ Non-standard license (Other) — review terms
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live weibocom/motan
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/weibocom/motan.
What it runs against: a local clone of weibocom/motan — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in weibocom/motan | Confirms the artifact applies here, not a fork |
| 2 | License is still Other | Catches relicense before you depend on it |
| 3 | Default branch master exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 195 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of weibocom/motan. If you don't
# have one yet, run these first:
#
# git clone https://github.com/weibocom/motan.git
# cd motan
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of weibocom/motan and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "weibocom/motan(\\.git)?\\b" \\
&& ok "origin remote is weibocom/motan" \\
|| miss "origin remote is not weibocom/motan (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(Other)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"Other\"" package.json 2>/dev/null) \\
&& ok "license is Other" \\
|| miss "license drift — was Other at generation time"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 4. Critical files exist
test -f "motan-core/src/main/java/com/weibo/api/motan/admin/AbstractAdminServer.java" \\
&& ok "motan-core/src/main/java/com/weibo/api/motan/admin/AbstractAdminServer.java" \\
|| miss "missing critical file: motan-core/src/main/java/com/weibo/api/motan/admin/AbstractAdminServer.java"
test -f "motan-benchmark/motan-benchmark-api/src/main/java/com/weibo/motan/benchmark/BenchmarkService.java" \\
&& ok "motan-benchmark/motan-benchmark-api/src/main/java/com/weibo/motan/benchmark/BenchmarkService.java" \\
|| miss "missing critical file: motan-benchmark/motan-benchmark-api/src/main/java/com/weibo/motan/benchmark/BenchmarkService.java"
test -f "motan-benchmark/motan-benchmark-server/src/main/resources/motan-benchmark-server.xml" \\
&& ok "motan-benchmark/motan-benchmark-server/src/main/resources/motan-benchmark-server.xml" \\
|| miss "missing critical file: motan-benchmark/motan-benchmark-server/src/main/resources/motan-benchmark-server.xml"
test -f "motan-benchmark/motan-benchmark-client/src/main/resources/motan-benchmark-client.xml" \\
&& ok "motan-benchmark/motan-benchmark-client/src/main/resources/motan-benchmark-client.xml" \\
|| miss "missing critical file: motan-benchmark/motan-benchmark-client/src/main/resources/motan-benchmark-client.xml"
test -f "motan-core/src/main/java/com/weibo/api/motan/admin/AdminCommandHandler.java" \\
&& ok "motan-core/src/main/java/com/weibo/api/motan/admin/AdminCommandHandler.java" \\
|| miss "missing critical file: motan-core/src/main/java/com/weibo/api/motan/admin/AdminCommandHandler.java"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 195 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~165d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/weibocom/motan"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
Motan is a cross-language RPC framework written primarily in Java (2.3M LOC) that enables rapid development of high-performance distributed services with support for multiple language implementations (Go, PHP, Lua). It provides service discovery integration (Consul, Zookeeper), weighted load-balancing, IDC scheduling, and both synchronous and asynchronous invocation patterns. Maven multi-module monorepo structure: motan-benchmark/ contains API specs and client implementations for performance testing, docs/wiki/ holds comprehensive Chinese and English user/development guides, and the core RPC engine lives in sibling modules (not fully listed but referenced via pom parent motan-core and motan-transport-netty).
👥Who it's for
Backend engineers and infrastructure teams at organizations like Weibo building microservices that need language-agnostic RPC communication, service discovery, and advanced traffic scheduling without implementing these patterns from scratch.
🌱Maturity & risk
Production-ready with active maintenance: the project has Maven Central releases (v1.1.12+), comprehensive documentation in docs/wiki/, CI/CD pipeline (.github/workflows/ci.yml), and a complete benchmark suite. However, the SNAPSHOT version 1.2.7 suggests ongoing development, and the primary Java codebase indicates this is a mature but still-evolving project.
Low risk for Java users given Maven Central distribution and established patterns; however, cross-language coordination risk exists since Go/PHP/Lua implementations are separate repos requiring independent maintenance. Last commit recency and open issue backlog are not visible in provided metadata, so verify before production adoption.
Active areas of work
Active development visible in SNAPSHOT versioning (1.2.7-SNAPSHOT). Benchmark module actively maintained with assembly/packaging setup for distribution. Exact current work items require inspection of GitHub issues/PRs, which are not visible in provided metadata.
🚀Get running
git clone https://github.com/weibocom/motan.git
cd motan
mvn clean install
mvn -pl motan-benchmark/motan-benchmark-client exec:java
Daily commands:
For benchmarking: ./motan-benchmark/motan-benchmark-client/src/main/bin/start.sh (requires assembled distribution). For development: mvn clean test runs unit tests; see individual pom.xml files in motan-benchmark-api/ and motan-benchmark-client/ for module-specific builds.
🗺️Map of the codebase
motan-core/src/main/java/com/weibo/api/motan/admin/AbstractAdminServer.java— Core admin server implementation that handles runtime management commands and monitoring for Motan servicesmotan-benchmark/motan-benchmark-api/src/main/java/com/weibo/motan/benchmark/BenchmarkService.java— Reference API interface defining the RPC service contract for performance testingmotan-benchmark/motan-benchmark-server/src/main/resources/motan-benchmark-server.xml— Configuration template showing how to wire up Motan service providers and protocol bindingsmotan-benchmark/motan-benchmark-client/src/main/resources/motan-benchmark-client.xml— Configuration template for Motan RPC client initialization and service discovery setupmotan-core/src/main/java/com/weibo/api/motan/admin/AdminCommandHandler.java— Interface for extensible admin command handling; core extension point for custom operational commandsmotan-benchmark/motan-benchmark-client/src/main/java/com/weibo/motan/benchmark/MotanBenchmarkClient.java— Entry point demonstrating typical client-side RPC usage patterns and request lifecycle
🧩Components & responsibilities
- Admin Server (Java NIO/Netty for command socket, CommandHandler plugin interface) — Handles operational commands, permission checking, and system introspection
🛠️How to make changes
Add a Custom Admin Command Handler
- Create a new handler class extending AbstractAdminCommandHandler in motan-core/src/main/java/com/weibo/api/motan/admin (
motan-core/src/main/java/com/weibo/api/motan/admin/AbstractAdminCommandHandler.java) - Implement the command() method to define your command name and execute() to implement logic (
motan-core/src/main/java/com/weibo/api/motan/admin/AdminCommandHandler.java) - Register the handler in AbstractAdminServer by adding it to the handler registry during initialization (
motan-core/src/main/java/com/weibo/api/motan/admin/AbstractAdminServer.java)
Implement a New RPC Service
- Define the service interface in a shared API module (similar to BenchmarkService.java) (
motan-benchmark/motan-benchmark-api/src/main/java/com/weibo/motan/benchmark/BenchmarkService.java) - Create a server implementation class implementing the interface (
motan-benchmark/motan-benchmark-server/src/main/java/com/weibo/motan/benchmark/BenchmarkServiceImpl.java) - Register the service in motan-benchmark-server.xml with <motan:service interface=... ref=... /> (
motan-benchmark/motan-benchmark-server/src/main/resources/motan-benchmark-server.xml) - Reference the service in motan-benchmark-client.xml with <motan:referer interface=... /> (
motan-benchmark/motan-benchmark-client/src/main/resources/motan-benchmark-client.xml)
Add a New Benchmark Test Case
- Create a new test runnable class extending AbstractClientRunnable in motan-benchmark-client (
motan-benchmark/motan-benchmark-client/src/main/java/com/weibo/motan/benchmark/AbstractClientRunnable.java) - Implement the call() method with your specific test scenario (e.g., TestStringRunnable pattern) (
motan-benchmark/motan-benchmark-client/src/main/java/com/weibo/motan/benchmark/TestStringRunnable.java) - Register the runnable in MotanBenchmarkClient and configure it in benchmark.properties (
motan-benchmark/motan-benchmark-client/src/main/java/com/weibo/motan/benchmark/MotanBenchmarkClient.java)
🔧Why these technologies
- Java/Maven — Primary implementation language; Maven for dependency management and multi-module builds
- XML Configuration — Declarative service wiring, protocol binding, and registry configuration without code changes
- Cross-language Protocol Support — RPC protocol abstraction enables interoperability with Go, PHP, and Lua implementations
- Admin Server Interface — Runtime management and operational controls (traffic switching, fault injection, metrics export)
⚖️Trade-offs already made
-
XML-based configuration over annotation-driven setup
- Why: Explicit configuration visibility and ease of dynamic updates without recompilation
- Consequence: Slightly more verbose than Spring annotations, but more flexible for ops teams and configuration management
-
Separate benchmark module vs integrated load testing
- Why: Isolation allows independent tuning and prevents test artifacts from affecting production code
- Consequence: Additional module to maintain, but cleaner separation of concerns
-
Handler-based command dispatch for admin operations
- Why: Plugin architecture allows extending operational capabilities without modifying core
- Consequence: More code ceremony for simple commands, but enables rich ecosystem of admin tools
🚫Non-goals (don't propose these)
- Not a full-featured service mesh (Istio-like traffic management)
- Does not provide built-in authentication/TLS at the RPC protocol layer (delegated to transport)
- Not designed for real-time streaming (request-response focused)
- Does not include a web UI for management (admin API only; UI built separately)
🪤Traps & gotchas
Spring Framework version pinning (4.2.4.RELEASE in quick-start examples) is outdated; verify compatibility with your target Spring version. Service discovery backend (Consul or Zookeeper) must be running and accessible for production deployments. Language-specific clients (Go, PHP) are in separate repos and version-coordination between Java and other implementations requires manual alignment. Benchmark module uses Maven assembly plugin for packaging; ensure Maven shade/assembly configurations are not modified without understanding artifact layout impact.
🏗️Architecture
💡Concepts to learn
- Service Discovery (Consul/Zookeeper) — Motan's killer feature is automatic registration and discovery of services; understanding how it integrates with Consul or Zookeeper is essential to deploy production clusters without hardcoding IPs
- Weighted Load-Balancing — Motan supports assigning different traffic weights to service instances across IDCs; this is non-trivial scheduling logic that affects request routing and requires understanding the load-balancer plugin interface
- Cross-IDC Scheduling — Motan can route requests across geographically distributed datacenters with locality preferences; essential for understanding how Motan handles failures and latency optimization in Weibo's multi-region infrastructure
- Asynchronous RPC Calls (Futures/Callbacks) — Beyond synchronous blocking calls, Motan supports async invocation patterns to avoid thread exhaustion under high concurrency; critical for designing non-blocking distributed systems
- Protocol Abstraction & Codec Design — Motan decouples transport (Netty) from protocol serialization, allowing multiple language implementations to interchange messages; understanding the codec contract is required for cross-language debugging
- Circuit Breaker Pattern — Production RPC frameworks include fault tolerance mechanisms to prevent cascading failures; Motan likely implements circuit breaker semantics for handling unavailable service instances gracefully
- Spring Framework Integration (Bean Lifecycle) — Motan's motan-springsupport module auto-wires RPC references and exports services as Spring beans; understanding Spring lifecycle hooks is required to debug initialization order and configuration binding issues
🔗Related repos
weibocom/motan-go— Official Go implementation of Motan RPC, enabling services written in Go to join the same Motan ecosystem and communicate with Java servicesweibocom/motan-php— Official PHP client library for Motan, allowing PHP applications to invoke Motan services directly or through a Motan-go agentweibocom/motan-openresty— Lua/LuaJIT implementation of Motan for OpenResty, enabling high-performance edge/API gateway scenarios to participate in Motan service meshesgrpc/grpc— Industry standard RPC framework solving similar cross-language distributed communication problems; understanding gRPC design (Protocol Buffers, HTTP/2) provides context for why Motan chose alternative protocol approachesapache/dubbo— Chinese ecosystem RPC framework with similar Zookeeper/Consul integration and load-balancing features; competitor/alternative with overlapping user base
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive unit tests for motan-benchmark modules
The motan-benchmark directory contains multiple client/server components (AbstractBenchmarkClient, ClientStatistics, RunnableStatistics, etc.) but there's no visible test directory. These benchmark utilities are critical for performance validation and should have unit tests covering edge cases in statistics calculation, concurrent runnable execution, and result aggregation.
- [ ] Create motan-benchmark/motan-benchmark-client/src/test/java directory structure
- [ ] Add unit tests for ClientStatistics class covering concurrent increment operations and percentile calculations
- [ ] Add unit tests for RunnableStatistics verifying result aggregation across multiple test runnables
- [ ] Add unit tests for AbstractClientRunnable covering timeout and exception handling scenarios
- [ ] Update motan-benchmark/motan-benchmark-client/pom.xml to include test dependencies (junit, mockito)
Create CI workflow for motan-benchmark module validation
The .github/workflows/ci.yml exists but likely doesn't include benchmark build/test validation. Given that motan-benchmark is a critical module for performance regression testing, it should have dedicated CI steps to ensure benchmark code compiles and test suite passes on every commit.
- [ ] Review current .github/workflows/ci.yml to identify if benchmark modules are tested
- [ ] Add explicit Maven build steps for 'motan-benchmark-api', 'motan-benchmark-client', and 'motan-benchmark-server' modules
- [ ] Add Maven test execution step specifically for motan-benchmark modules (mvn test -pl motan-benchmark-client)
- [ ] Configure CI to fail if benchmark module compilation or tests fail
Add missing documentation for benchmark execution and configuration
The docs/wiki directory contains configuration and development guides, but there's no specific documentation for running benchmarks or interpreting benchmark results. The motan-benchmark-client/src/main/resources/benchmark.properties file exists but isn't documented, and benchmark.properties configuration options should be explained in the wiki.
- [ ] Create docs/wiki/zh_benchmark.md (Chinese) documenting benchmark.properties configuration parameters
- [ ] Create docs/wiki/en_benchmark.md (English) explaining how to run benchmark tests, interpret results, and configure performance test scenarios
- [ ] Document the purpose and interpretation of metrics from ClientStatistics and RunnableStatistics classes
- [ ] Update docs/wiki/_Sidebar.md to include links to new benchmark documentation pages
🌿Good first issues
- Add integration tests for Motan clients against multiple service discovery backends (Consul and Zookeeper separately) in
motan-benchmark/to improve coverage of the critical path - Expand
docs/wiki/en_quickstart.mdwith a step-by-step Docker Compose example (Docker setup for local Consul/Zookeeper + Motan server/client) to reduce setup friction for new contributors - Create a
motan-benchmark/motan-benchmark-api/src/test/java/test suite validating serialization/deserialization of Person.java and FullName.java against the protocol codec to catch cross-language compatibility regressions early
⭐Top contributors
Click to expand
Top contributors
- @rayzhang0603 — 93 commits
- @zhanglei28 — 6 commits
- @sunnights — 1 commits
📝Recent commits
Click to expand
Recent commits
4c18b71— Merge pull request #1087 from weibocom/fix_security_issue (rayzhang0603)a898304— add serialize blacklist (rayzhang0603)b5f3c42— update git ignore (rayzhang0603)7122f2f— new version 1.2.7-SNAPSHOT (rayzhang0603)5efe006— release 1.2.6 (rayzhang0603)05d6dd8— Merge pull request #1082 from weibocom/feat/gray_group (rayzhang0603)fd65e58— remove useless code (rayzhang0603)d2d5ff1— Merge branch 'master' into feat/gray_group (rayzhang0603)7484dd8— Merge pull request #1081 from weibocom/feat/support_set_attachments_on_server_side (rayzhang0603)8d521ad— support grey cluster (rayzhang0603)
🔒Security observations
The Motan RPC framework codebase shows a moderate security posture. Key concerns include: use of SNAPSHOT versions in what appears to be benchmark code, potential unmanaged transitive dependencies, and absence of visible security policies. The primary risks are related to dependency management and version control rather than code-level vulnerabilities in the visible files. The codebase lacks explicit security configuration in shell scripts and Log4j security hardening documentation. Recommendations focus on hardening dependency management, establishing a security policy, updating to stable versions, and implementing CI/CD security scanning. No critical vulnerabilities were identified in the visible file structure,
- Medium · Incomplete POM Configuration —
motan-benchmark/motan-benchmark-api/pom.xml. The motan-benchmark-api/pom.xml is missing critical dependency declarations. While the parent POM is referenced, the absence of explicit dependency management could lead to transitive dependency vulnerabilities that are not directly visible or managed. Fix: Ensure all dependencies are explicitly declared with pinned versions in the POM file. Use dependency management sections to control transitive dependencies. Run 'mvn dependency:tree' to identify and audit all transitive dependencies for known vulnerabilities. - Medium · Snapshot Version in Use —
motan-benchmark/motan-benchmark-api/pom.xml (and parent POM). The project uses version '1.2.7-SNAPSHOT' which indicates development/unstable builds. Snapshot versions can introduce unpredictable behavior and may contain unvetted code. Production deployments should use release versions. Fix: Use stable release versions (e.g., 1.2.7) in production environments. Implement version pinning and release management practices. Only use SNAPSHOT versions in development environments with proper access controls. - Low · Missing Security Configuration in Shell Scripts —
motan-benchmark/motan-benchmark-client/src/main/bin/start.sh, motan-benchmark/motan-benchmark-server/src/main/bin/start.sh. The start.sh and stop.sh scripts in benchmark modules lack visible security controls. Shell scripts handling application startup should implement proper permission checks, input validation, and secure environment variable handling. Fix: Review and harden shell scripts by: 1) Setting proper file permissions (chmod 755 for executables), 2) Validating all input parameters, 3) Using absolute paths, 4) Implementing proper error handling, 5) Avoiding hardcoded credentials, 6) Using 'set -euo pipefail' for safety. - Low · Log4j Configuration Files Present —
motan-benchmark/motan-benchmark-client/src/main/resources/log4j.properties, motan-benchmark/motan-benchmark-server/src/main/resources/log4j.properties. Log4j configuration files are present in the codebase (log4j.properties). Depending on the Log4j version used, there may be known vulnerabilities (e.g., Log4Shell - CVE-2021-44228 for versions < 2.17.0). Fix: 1) Verify the Log4j version in parent POM is 2.17.0 or later, 2) Enable message lookups protection with 'log4j2.formatMsgNoLookups=true', 3) Regularly update Log4j to latest patch versions, 4) Monitor security advisories. - Low · No Visible Security Policy or Guidelines —
Repository root. No SECURITY.md or security policy document is visible in the provided file structure. This makes it difficult for security researchers to report vulnerabilities responsibly. Fix: Create a SECURITY.md file following the GitHub Security Policy template. Include: 1) How to report vulnerabilities, 2) Expected response times, 3) Disclosure policy, 4) Security contacts, 5) Supported versions and security patches. - Low · Insufficient Visibility on Dependency Audit —
motan-benchmark/motan-benchmark-api/pom.xml and parent modules. The provided POM file shows minimal dependency declarations. Without seeing the full dependency tree, potential vulnerable transitive dependencies cannot be fully assessed. Fix: 1) Run 'mvn clean verify dependency:tree -DoutputFile=dependency-tree.txt', 2) Use OWASP Dependency-Check plugin, 3) Integrate with CI/CD for continuous vulnerability scanning, 4) Keep audit reports in version control.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.