From 4779cae33819dfc7650e5401cbcd3960f0b248d4 Mon Sep 17 00:00:00 2001 From: Dave Syer Date: Wed, 15 Jan 2025 09:19:19 +0000 Subject: [PATCH] Add note on local.grpc.port --- .../src/main/antora/modules/ROOT/pages/client.adoc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/spring-grpc-docs/src/main/antora/modules/ROOT/pages/client.adoc b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/client.adoc index bb97af6..7dfdbfa 100644 --- a/spring-grpc-docs/src/main/antora/modules/ROOT/pages/client.adoc +++ b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/client.adoc @@ -142,6 +142,15 @@ SimpleGrpc.SimpleBlockingStub stub(GrpcChannelFactory channels, @LocalGrpcPort i } ---- +The channel can be configured via `application.properties` as well, by using the ``${local.grpc.port}` property placeholder. +The `@Bean` where you create the stub must still be `@Lazy` for the same reason as above. +For example: + +[source,properties] +---- +spring.grpc.client.channels.local.address=0.0.0.0:${local.grpc.port} +---- + [[client-interceptor]] == Client Interceptors