Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 1.05 KB

dubbo_json_rpc.md

File metadata and controls

45 lines (32 loc) · 1.05 KB

Dubbo JSON RPC Example

Quick Start

  1. Edit config file,add dubbo_json_rpc filter

jsonrpc.jpg

  1. Compile and start layotto
go build -o layotto cmd/layotto/main.go
./layotto -c demo/rpc/dubbo_json_rpc/example.json
  1. 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
  1. 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}'

jsonrpc.jpg

Next Step

If you are interested in the implementation principle, or want to extend some functions, you can read RPC design document