commit | a2ec4b1abc7e66bf42c14439295d5e8c8a9ee12f | [log] [tgz] |
---|---|---|
author | Joe Zou <joezou@apache.org> | Tue Dec 15 23:11:37 2020 +0800 |
committer | GitHub <noreply@github.com> | Tue Dec 15 23:11:37 2020 +0800 |
tree | 0e0b94ee0187216ab25e197aa32b2268ff8e1473 | |
parent | 7a992b8629964eaa1e0d6dd85cab1455b9589372 [diff] | |
parent | 0c6af3617ea8c2a3021ab42656e50c4a87da985b [diff] |
Merge pull request #17 from apache/1.5.5 Add 1.5.5-rc1
README
Take
helloworld
as an example
A zookeeper server is required to run most of the samples in this repository. It can either start without docker environment like this:
zkServer start
or start when docker environment presents:
docker run --name zookeeper -p2181:2181 -d zookeeper
This samples repository provides an even more convenient way to start zookeeper:
cd helloworld/go-server make -f ../../build/Makefile docker-up
Once the following messages outputs, the zookeeper server is ready.
> Starting dependency services with docker/docker-compose.yml Creating network "docker_default" with the default driver Creating docker_zookeeper_1 ... done
To shutdown it, simple run
make -f ~/github/apache/dubbo-go-samples/build/Makefile docker-down
Use the following commands to start go-server
.
cd helloworld/go-server make -f ../../build/Makefile start
Once the following messages outputs, the server is ready.
> Buiding application binary: dist/darwin_amd64/release/go-server > Starting application go-server, output is redirected to dist/darwin_amd64/release/go-server.log > PID: 86428
The output of go-server
can be found from ‘dist/darwin_amd64/release/go-server.log’.
Use the following commands to run go-client
.
cd helloworld/go-client make -f ../../build/Makefile run
Once the following messages outputs, the go-client
calls the go-server
successfully.
> Buiding application binary: dist/darwin_amd64/release/go-client > Running application go-client, output is redirected to dist/darwin_amd64/release/go-client.log ... 2020-10-27T14:51:37.520+0800 DEBUG dubbo/dubbo_invoker.go:144 result.Err: <nil>, result.Rest: &{A001 Alex Stocks 18 2020-10-27 14:51:37.52 +0800 CST} 2020-10-27T14:51:37.520+0800 DEBUG proxy/proxy.go:177 [makeDubboCallProxy] result: &{A001 Alex Stocks 18 2020-10-27 14:51:37.52 +0800 CST}, err: <nil> response result: &{A001 Alex Stocks 18 2020-10-27 14:51:37.52 +0800 CST}
dubbo-go-samples is designed to serve the purposes of not only the show cases of how to use apache/dubbo-go but also the integration-test for apache/dubbo-go. To run integration test for go-server
, run the following commands:
cd helloworld/go-server make -f ../../build/Makefile integration
Once the following messages outputs, the integration tests pass.
> Running integration test for application go-server ... --- PASS: TestGetUser (0.00s) PASS ok github.com/apache/dubbo-samples/golang/helloworld/go-server/tests/integration 3.603s
To clean up, run the following command:
cd helloworld/go-server make -f ../../build/Makefile clean make -f ../../build/Makefile docker-down
Environment Variable
APP_LOG_CONF_FILE
. eg: /home/xx/dubbogo-samples/helloworld/client/conf/log.yml
CONF_CONSUMER_FILE_PATH
eg: /home/xx/dubbogo-samples/helloworld/client/conf/client.yml
CONF_PROVIDER_FILE_PATH
eg: /home/xx/dubbogo-samples/helloworld/server/conf/server.yml
Click Apply, then you are all set to run.
If you want to add some samples, we hope that you can do this: