lizining1231 opened a new issue, #3688:
URL: https://github.com/apache/dubbo-go/issues/3688
### Summary
`tools/benchmark`'s
[README\_CN.md](file:///home/lizining/projects/dubbogo/tools/benchmark/README_CN.md)
documents `dubbo-java` as a supported framework (`--framework` accepts
`dubbo-java`), but neither the client nor the two scripts implement it, and the
Java server itself has three blockers: protocol mismatch, build failure and
instant shutdown. The three way comparison (dubbo-go / grpc / dubbo-java) has
therefore always been missing the Java leg:
1. **Client rejects it**: `client/main.go` exits with `Invalid framework`
for `--framework dubbo-java`.
2. **Scripts don't support it**: `run_single.sh` / `run_all.sh` fall into
`Unsupported framework` /
`Skipping unknown framework` for `dubbo-java`.
3. **Protocol mismatch**: the Java server speaks the legacy `dubbo` protocol
with hand-written message
classes (package `org.apache.dubbo.benchmark`), while the Go client only
speaks `triple` + `protobuf`
and resolves `benchmark.BenchmarkService` — protocol, serialization and
service name all disagree,
so cross-language calls are impossible.
4. **Build failure**: `pom.xml` uses `${spring-boot.version}` as the
spring-boot parent version, which
Maven cannot resolve while parsing the parent POM (resolution-order
limitation), so the build fails.
5. **Instant shutdown**: the non-web Spring Boot app (`spring-boot-starter`)
exits right after `main()`
returns; no non-daemon thread keeps the JVM alive, so the port is never
listened on.
### Affected Locations
| File
| Type | Related Source
Locations
|
|
-------------------------------------------------------------------------------------------
| ------------------------------------- |
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
| `tools/benchmark/client/main.go`
| missing `dubbo-java` branch |
<https://github.com/apache/dubbo-go/blob/main/tools/benchmark/client/main.go>
(`validFrameworks` / `createCaller` only cover `dubbo-go`/`grpc`)
|
| `tools/benchmark/scripts/run_single.sh`
| missing `dubbo-java` branch |
<https://github.com/apache/dubbo-go/blob/main/tools/benchmark/scripts/run_single.sh>
(`case "$FRAMEWORK"` only covers `dubbo-go`/`grpc`)
|
| `tools/benchmark/scripts/run_all.sh`
| missing `dubbo-java` branch |
<https://github.com/apache/dubbo-go/blob/main/tools/benchmark/scripts/run_all.sh>
(`FRAMEWORKS` only `dubbo-go`/`grpc`)
|
| `tools/benchmark/server/dubbo-java/pom.xml`
| parent version not resolvable |
<https://github.com/apache/dubbo-go/blob/main/tools/benchmark/server/dubbo-java/pom.xml>
(`${spring-boot.version}` as parent version)
|
|
`tools/benchmark/server/dubbo-java/src/main/resources/application.properties`
| stale protocol/scan config |
<https://github.com/apache/dubbo-go/blob/main/tools/benchmark/server/dubbo-java/src/main/resources/application.properties>
(`dubbo.protocol.name=dubbo`, `scan.base-packages=org.apache.dubbo.benchmark`)
|
| `tools/benchmark/server/dubbo-java/.../BenchmarkService.java` /
`BenchmarkServiceImpl.java` | hand-written messages + wrong package |
<https://github.com/apache/dubbo-go/blob/main/tools/benchmark/server/dubbo-java/src/main/java/org/apache/dubbo/benchmark/BenchmarkServiceImpl.java>
(`@DubboService` + hand-written `BenchmarkRequest`/`BenchmarkResponse` POJOs) |
| `tools/benchmark/server/dubbo-java/.../BenchmarkServer.java`
| exits immediately |
<https://github.com/apache/dubbo-go/blob/main/tools/benchmark/server/dubbo-java/src/main/java/org/apache/dubbo/benchmark/BenchmarkServer.java>
(`main` returns right after `SpringApplication.run`)
|
### Reproduction
```bash
# 1) The client rejects it outright
cd tools/benchmark/client && go build -o benchmark-client main.go \
&& ./benchmark-client --framework dubbo-java --payload 1024 --concurrency
50
# 2) The single-case script reports Unsupported
cd tools/benchmark && ./scripts/run_single.sh dubbo-java 1024 protobuf none
50 unary
# 3) The full script skips Java
cd tools/benchmark && ./scripts/run_all.sh
```
Output before the fix:
```bash
[ERROR] Invalid framework: dubbo-java. Valid values: dubbo-go, grpc
# client
[ERROR] Unsupported framework: dubbo-java
# run_single.sh
[INFO] ==== Testing framework: dubbo-go ====
# run_all.sh only
[INFO] ==== Testing framework: grpc ====
# dubbo-go/grpc
```
### Root Cause
- **Docs vs code divergence**: the README lists `dubbo-java` as supported,
but `validFrameworks` /
`createCaller` and both scripts' `case` branches lack it — "documented but
not implemented", so
following the README fails.
- **Cross-language contract mismatch (three places)**: the Java side speaks
`dubbo` (Go speaks `tri`),
uses hand-written message classes (Go only accepts `protobuf` bytes), and
exposes
`org.apache.dubbo.benchmark.BenchmarkService` while the Go client requests
`benchmark.BenchmarkService`.
Any single mismatch blocks routing to the Java provider.
- **Broken build chain**: `spring-boot-starter-parent`'s version is
`${spring-boot.version}`, but Maven
resolves the parent POM *before* loading child POM / CLI-injected
properties, so the version resolves
empty → build failure.
- **Lifecycle error**: the non-web `spring-boot-starter` returns from
`main()` immediately; with no
non-daemon threads left, the JVM exits and the port is never listened on.
### Proposed Fix
1. **Build fixes**: resolve the build failure and the artifact-name mismatch
with the docs
2. **Protocol migration**: switch the server from the dubbo protocol to
triple and align the cross-language contract
3. **Service registration and liveness**: fix the unregistered service and
the instant exit
4. **Client & script integration**: complete the end-to-end dubbo-java call
path
### Fix Status
- `mvn clean package -DskipTests` builds, producing
`target/benchmark-dubbo-java.jar`;
- `java -jar` starts within seconds, listens on 20001, exports
`benchmark.BenchmarkService` (tri);
- The smoke test passed with no failed requests.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]