- Edit config file,add
dubbo_json_rpc
filter
- Compile and start layotto
go build -o layotto cmd/layotto/main.go
./layotto -c demo/rpc/dubbo_json_rpc/example.json
- Start dubbo server
use dubbo-go-samples
repo's example server.
git clone [email protected]:apache/dubbo-go-samples.git
cd dubbo-go-samples
# start zookeeper
cd attachment/go-server
make -f ../../build/Makefile docker-up
cd -
# build dubbo server
cd general/jsonrpc/go-server
sh assembly/mac/dev.sh
# start dubbo server
cd target/darwin/{generate_folder}/
sh ./bin/load.sh start
- call runtime InvokerService api.
go run demo/rpc/dubbo_json_rpc/dubbo_json_client/client.go -d '{"jsonrpc":"2.0","method":"GetUser","params":["A003"],"id":9527}'
If you are interested in the implementation principle, or want to extend some functions, you can read RPC design document