Skip to content

Commit 7025016

Browse files
committed
Make grpc-client sample have default port 9090
Signed-off-by: onobc <chris.bono@gmail.com>
1 parent b89ecd2 commit 7025016

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

samples/grpc-client/README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,18 @@ $ ./mvnw spring-boot:run
1818
message: "Hello ==> Alien"
1919
```
2020

21-
You will need to set the property `launched.grpc.port` to the port the server is running on.
22-
If the server is running on port 9090, the property can be set using an environment variable.
23-
For example: `export LAUNCHED_GRPC_PORT=9090`.
21+
This sample app is only a gRPC client but still requires a running gRPC server in a separate process.
2422
The `grpc-server` sample can be used for the server.
2523

26-
You can also build and run the application as a native image using GraalVM, in the normal way for a Spring Boot application. E.g:
24+
If the server is not running on the default port `9090` then you will need to set the `launched.grpc.port` property to the port the server is running on.
25+
The property can be set via an environment variable, for example:
26+
```
27+
export LAUNCHED_GRPC_PORT=9090
28+
```
29+
30+
You can also build and run the application as a native image using GraalVM, for example:
2731

2832
```
2933
$ ./mvnw -Pnative native:compile
3034
$ ./target/grpc-client-sample
31-
...
35+
```
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
spring.application.name=grpc-client
2-
spring.grpc.client.default-channel.address=static://0.0.0.0:${launched.grpc.port}
2+
spring.grpc.client.default-channel.address=static://0.0.0.0:${launched.grpc.port:9090}
33

44
#logging.level.org.springframework.experimental.boot.server.exec=debug

0 commit comments

Comments
 (0)