Skip to content

Commit ad4ce7e

Browse files
committed
Cherry pick some docs updates
1 parent d452f80 commit ad4ce7e

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

spring-grpc-docs/pom.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
<artifactId>spring-grpc-spring-boot-starter</artifactId>
2929
<version>${project.version}</version>
3030
</dependency>
31+
<dependency>
32+
<groupId>org.springframework.grpc</groupId>
33+
<artifactId>spring-grpc-test-spring-boot-autoconfigure</artifactId>
34+
<version>${project.version}</version>
35+
</dependency>
3136
<dependency>
3237
<groupId>com.fasterxml.jackson.core</groupId>
3338
<artifactId>jackson-databind</artifactId>

spring-grpc-docs/src/main/antora/modules/ROOT/pages/server.adoc

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,13 @@ If you want to do that in any Spring Boot application, it should be sufficient *
125125
This dependency is only provided by the `spring-grpc-server-web-spring-boot-starter` (or if you include it explicitly yourself), but if you need to be explicit you can set `spring.grpc.server.servlet.enabled=false` in your application configuration.
126126

127127
[[in-process-server]]
128-
== In-Process Transport
128+
== InProcess Server
129129

130-
You can run an in-process server (i.e. not listening on a network port) by including the `io.grpc:grpc-inprocess` dependency on your classpath and specifying the `spring.grpc.server.inprocess.name` property which is used as the identity of the server for clients to connect to.
130+
You can run an in-process server (i.e. not listening on a network port) by including the `io.grpc.grpc-inprocess` dependency on your classpath and specifying the `spring.grpc.server.inprocess.name` property which is used as the identity of the server for clients to connect to.
131131

132132
In this mode, the in-process server factory is auto-configured in *addition* to the regular server factory (e.g. Netty).
133133

134-
NOTE: In application code, to connect a client to the inprocess server the channel target can be set to `in-process:<in-process-name>`.
135-
In tests, if you are using only the in-process transport (see <<Testing,Testing>>), the autoconfigured `GrpcChannelFactory` will automatically connect to the in-process server without any special configuration.
134+
NOTE: To use the inprocess server the channel target must be set to `in-process:<in-process-name>`
136135

137136

138137
[[server-interceptor]]
@@ -168,7 +167,7 @@ ServerInterceptorFilter myInterceptorFilter() {
168167
}
169168
----
170169

171-
An `InProcessGrpcServerFactory` picks up the `ServerInterceptorFilter` automatically, if it is present.
170+
An `InProcessGrpcServerFactory` picks up the `ServerInterceptorFilter` automatically.
172171
Any other server factory will require you to provide a `GrpcServerFactoryCustomizer` in which you can modify the factory by adding a filter, as shown in the following example:
173172

174173
[source,java]
@@ -239,15 +238,10 @@ A `GrpcExceptionHandler` can be used to handle exceptions of a specific type, re
239238
== Testing
240239

241240
If you include `spring-grpc-test` in your project, your gRPC server in a `@SpringBootTest` can be started in-process (i.e. not listening on a network port) by enabling the in-process server.
242-
Additionally the `grpc-inprocess` dependency must be present on the classpath (which is automatic if you already depend on `spring-grpc-test``).
243-
All clients that connect to any server via the autoconfigured `GrpcChannelFactory` will be able to connect to it instead.
241+
All clients that connect to any server via the autoconfigured `GrpcChannelFactory` will be able to connect to it.
242+
You can switch the in-process server on by setting `spring.grpc.test.inprocess.enabled` to `true` or by adding the `@AutoConfigureInProcessTransport` annotation to your `@SpringBootTest` class.
244243

245-
The in-process transport is an opt-in feature, so it requires an explicit configuration.
246-
You can switch it on by setting `spring.grpc.test.inprocess.enabled` to `true` or by adding the `@AutoConfigureInProcessTransport` annotation to your `@SpringBootTest` class.
247-
There is no need to set `spring.grpc.server.inprocess.name` as that is done automatically.
248-
Using the annotation is equivalent to setting the "enabled" property to true, and in addition marking the in-process transport as "exclusive", meaning that no other transport will be used.
249-
250-
NOTE: When the in-process server is run in test mode using `@AutoConfigureInProcessTransport` (as opposed to <<in-process-server,running in an application>>) it replaces the regular server and channel factories (e.g. Netty)
244+
NOTE: When the in-process server is run in test mode (as opposed to <<in-process-server,running normally>>) it replaces the regular server and channel factories (e.g. Netty)
251245

252246

253247
== Security

spring-grpc-docs/src/main/antora/modules/ROOT/partials/_configprops.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,6 @@
5656
|spring.grpc.server.ssl.client-auth | `+++none+++` | Client authentication mode.
5757
|spring.grpc.server.ssl.enabled | | Whether to enable SSL support.
5858
|spring.grpc.server.ssl.secure | `+++true+++` | Flag to indicate that client authentication is secure (i.e. certificates are checked). Do not set this to false in production.
59+
|spring.grpc.test.inprocess.enabled | `+++false+++` | Whether to enable the in-process server and client for testing. Consider using @AutoConfigInProcessTransport instead.
5960

6061
|===

0 commit comments

Comments
 (0)