English | 中文
There are two ways to run dubbo-go samples:
- Script-driven integration testing (CI flow)
- Manual run without scripts
Current CI uses script-driven integration tests.
For one sample, ./integrate_test.sh <sample-path> executes:
- Start
go-server - Start auxiliary Go servers (
*-server/cmd/*.go, e.g.grpc-server) - Run
go-client - Run
java-client(if present) - Stop
go-server - Start
java-server(if present) - Run
java-client(if present) - Run
go-clientagain (verify Go client can call Java server)
Notes:
- If
mvnis unavailable, Java phases are skipped automatically. - Java server readiness is checked by TCP port before Java/Go client phases continue.
- Default Java server endpoint is
127.0.0.1:20000(can be overridden by env vars inintegrate_test.sh).
Prerequisite:
- Docker / Docker Compose
- Go toolchain
- Maven (optional but required for Java phases)
Run all samples in CI list:
./start_integrate_test.shstart_integrate_test.sh will:
- Start dependencies via root
docker-compose.yml - Health-check dependencies
- Run each sample by calling
./integrate_test.sh <sample> - Stop dependencies at exit (success or failure)
Run a single sample:
./integrate_test.sh helloworld
./integrate_test.sh directUseful env vars:
GO_CLIENT_TIMEOUT_SECONDS(default:90)JAVA_CLIENT_TIMEOUT_SECONDS(default:180)JAVA_SERVER_READY_TIMEOUT_SECONDS(default:60)JAVA_SERVER_HOST(default:127.0.0.1)JAVA_SERVER_PORT(default:20000)
Create a sample directory with at least:
-
go-server/cmd/*.go -
go-client/cmd/*.go -
Optional Java interop:
java-server/run.shjava-client/run.sh
Requirements for Java scripts:
java-server/run.shshould keep server process alive (do not rely on stdin in background mode).java-client/run.shshould exit with non-zero on failure.
Validation steps:
- Run the sample only:
./integrate_test.sh <your-sample-path>
- Add it into the
arraylist instart_integrate_test.sh. - Run full flow:
./start_integrate_test.sh
- Ensure failure paths are visible (non-zero exit code, useful logs).
This section shows how to run one sample manually, without start_integrate_test.sh or integrate_test.sh.
Example sample: helloworld
cd <PATH OF dubbo-go-samples>
docker compose -f docker-compose.yml up -dIf your environment uses legacy compose:
docker-compose -f docker-compose.yml up -dOpen a new terminal:
cd <PATH OF dubbo-go-samples>/helloworld
export DUBBO_GO_CONFIG_PATH=./go-server/conf/dubbogo.yml
go run ./go-server/cmd/*.goOpen another terminal:
cd <PATH OF dubbo-go-samples>/helloworld
export DUBBO_GO_CONFIG_PATH=./go-client/conf/dubbogo.yml
go run ./go-client/cmd/*.go- Stop Go server (Ctrl+C in Go server terminal).
- Start Java server:
cd <PATH OF dubbo-go-samples>/helloworld/java-server bash ./run.sh
- Run Java client:
cd <PATH OF dubbo-go-samples>/helloworld/java-client bash ./run.sh
- Run Go client again (from step 2.3 terminal) to verify Go -> Java call.
Stop foreground processes with Ctrl+C, then:
cd <PATH OF dubbo-go-samples>
docker compose -f docker-compose.yml down