English | 中文
There are two ways to run dubbo-go samples:
Current CI uses script-driven integration tests.
For one sample, ./integrate_test.sh <sample-path> executes:
go-server*-server/cmd/*.go, e.g. grpc-server)go-clientjava-client (if present)go-serverjava-server (if present)java-client (if present)go-client again (verify Go client can call Java server)Notes:
mvn is unavailable, Java phases are skipped automatically.127.0.0.1:20000 (can be overridden by env vars in integrate_test.sh).start_integrate_test.sh and integrate_test.shPrerequisite:
Run all samples in CI list:
./start_integrate_test.sh
start_integrate_test.sh will:
docker-compose.yml./integrate_test.sh <sample>Run a single sample:
./integrate_test.sh helloworld ./integrate_test.sh direct
Useful 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.shRequirements for Java scripts:
java-server/run.sh should keep server process alive (do not rely on stdin in background mode).java-client/run.sh should exit with non-zero on failure.Validation steps:
./integrate_test.sh <your-sample-path>
array list in start_integrate_test.sh../start_integrate_test.sh
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 -d
If your environment uses legacy compose:
docker-compose -f docker-compose.yml up -d
Open 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/*.go
Open 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
cd <PATH OF dubbo-go-samples>/helloworld/java-server bash ./run.sh
cd <PATH OF dubbo-go-samples>/helloworld/java-client bash ./run.sh
Stop foreground processes with Ctrl+C, then:
cd <PATH OF dubbo-go-samples> docker compose -f docker-compose.yml down