Add note on local.grpc.port

This commit is contained in:
Dave Syer
2025-01-15 09:19:19 +00:00
parent 4efd23aa4e
commit 4779cae338

View File

@@ -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