English | 简体中文
Provide consumer and provider applications which based on gRPC framework, to show how to make gRPC application access polaris rapidly.
- provider: gRPC server application, demo service register, deregister, heartbeat.
- consumer: gRPC client application, demo service discovery, and load balance.
Modify polaris.yaml in provider and consumer, which is showed as below:
besides, ${ip} and ${port} is the address of polaris server.
global:
serverConnector:
addresses:
- ${ip}:${port}Build provider with go mod:
cd provider
go build -o providerBuild consumer with go mod:
cd consumer
go build -o consumer
go mod compile and build:
cd provider
go build -o providerrun binary executable:
./providergo mod compile and build:
cd consumer
go build -o consumerrun binary executable:
./consumerLogin into polaris console, and check the instances in Service EchoServerGRPC.
Invoke http call,replace ${app.port} to the consumer port (18080 by default).
curl -L -X GET 'http://localhost:${app.port}/echo?value=hello_world'expect:echo: hello_world