-
Try the local-grpc-server example first run:
./gradlew :example:local-grpc-server:bootRun
-
In a different terminal window run:
./gradlew :example:local-grpc-client:bootRun
-
Visit http://localhost:8080/ to see the result.
-
Choose a cloud discovery implementation:
consul
eureka
nacos
Note: In your actual application you are free to choose any cloud discovery implementation, but only the above and
zookeeper
will automatically register the server at the discovery service. So you might have to write a few extra lines in your server application. Generic registration support is planned for a future release. No additional configuration is required for clients. -
Start the discovery server (only the chosen one):
# Consul docker run --name=consul -p 8500:8500 consul # Eureka ./gradlew :example:cloud-eureka-server:bootRun # Nacos docker run --env MODE=standalone --name nacos -d --rm -p 8848:8848 nacos/nacos-server
-
Insert the selected implementation and start the server application (in a new terminal window):
./gradlew -Pdiscovery=$discovery :example:cloud-grpc-server:bootRun
-
Insert the selected implementation and start the client application (in a new terminal window):
./gradlew -Pdiscovery=$discovery :example:cloud-grpc-client:bootRun
-
Visit http://localhost:8080/ to see the result.
-
Try the security-grpc-server example first run:
./gradlew :example:security-grpc-server:bootRun
-
In a different terminal window run:
./gradlew :example:security-grpc-client:bootRun
-
Visit http://localhost:8080/ to see the result.
You can configure the client's username in the application.yml.