Skip to content

Commit 3523201

Browse files
committed
Improve example readme
1 parent 65bd4aa commit 3523201

File tree

1 file changed

+24
-11
lines changed

1 file changed

+24
-11
lines changed

examples/README.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# gRPC spring boot starter Examples
22

3-
## Local Mode
3+
## Local Setup
44

55
1. Try the local-grpc-server example first run:
66

@@ -16,28 +16,41 @@
1616

1717
3. Visit http://localhost:8080/ to see the result.
1818

19-
## Cloud Mode
19+
## Cloud Discovery Setup
2020

21-
1. Try the cloud-eureka-server example first run:
21+
1. Choose a cloud discovery implementation:
22+
23+
- `consul`
24+
- `eureka`
25+
- `nacos`
26+
27+
> **Note:** In your actual application you are free to choose any cloud discovery implementation,
28+
> but only the above and `zookeeper` will automatically register the server at the discovery service.
29+
> So you might have to write a few extra lines in your server application.
30+
> Generic registration support is planned for a future release.
31+
> No additional configuration is required for clients.
32+
33+
2. Start the discovery server (only the chosen one):
2234

2335
````sh
36+
# Consul
37+
docker run --name=consul -p 8500:8500 consul
38+
# Eureka
2439
./gradlew :example:cloud-eureka-server:bootRun
40+
# Nacos
41+
docker run --env MODE=standalone --name nacos -d --rm -p 8848:8848 nacos/nacos-server
2542
````
2643

27-
2. Run zipkin-server
28-
29-
https://github.com/openzipkin/zipkin#quick-start
30-
31-
3. In a different terminal window run:
44+
3. Insert the selected implementation and start the server application (in a new terminal window):
3245

3346
````sh
34-
./gradlew :example:cloud-grpc-server:bootRun
47+
./gradlew -Pdiscovery=$discovery :example:cloud-grpc-server:bootRun
3548
````
3649

37-
4. In a different terminal window run:
50+
4. Insert the selected implementation and start the client application (in a new terminal window):
3851

3952
````sh
40-
./gradlew :example:cloud-grpc-client:bootRun
53+
./gradlew -Pdiscovery=$discovery :example:cloud-grpc-client:bootRun
4154
````
4255

4356
5. Visit http://localhost:8080/ to see the result.

0 commit comments

Comments
 (0)