Triple is dubbo3.0 network protocol. You can refer to dubbogo/triple repo for more information. Triple is extended from old Dubbogo framework, it supports pb serilization, and can interact with dubbo-java 3.0 and gRPC. It also support unary RPC and streaming RPC invocation. Triple is main protocol that Dubbo echology recommends.
dubbo: protocols: # dubbogo framework network protocol configuration myProtocol: # user defined protocol Key name: tri # protocol name, suppporting: tri/dubbo/grpc/jsonrpc port: 20000 # port to export service provider: services: MyProvider: # service provider type name interface: org.apache.dubbogo.MyProvider # user defined interface name # serialization: hessian2 # serialization that can be choosed:pb/hessian2/custome # pb serialization by default
dubbo: consumer: references: ClientImpl: # client struct type name protocol: tri # protocol name,supporting: tri/dubbo/grpc/jsonrpc,compatiable with server interface: org.apache.dubbo.demo.Greeter # user defined interface name # serialization: hessian2 # serialization that can be choosed:pb/hessian2/custome # pb serialization by default
We choose pb/dubbogo-grpc as an example, which is dubbogo-client invokes dubbogo-server using triple protocol and pb seriazliation.
Start zk server, listening on 127.0.0.1:2181. If you have installed docker locally, you can choose to exec following commands to start all componnets that dubbogo relies on: zk(2181), nacos(8848), etcd(2379).
docker-compose -f {PATH_TO_SAMPLES_PROJECT}/integrate_test/dockercompose/docker-compose.yml up -d
You can start client after server started.