Skip to content

Commit d93ad2b

Browse files
committed
Add more detail about disabling the servlet
1 parent a3d7ba6 commit d93ad2b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

+5
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ Clients can connect to the server using that path, which is what any gRPC client
8787
The gRPC server has fewer configuration options when running in a servlet container, as the servlet container is responsible for the network layer.
8888
You can still add `ServerBuilderCustomizer` beans to customize the server as it is built, but some features common in the "native" builders are not available and may throw exceptions at runtime.
8989

90+
== Native gRPC Server inside a Servlet Container
91+
The native gRPC server (with netty etc.) will run happily inside a web application, listening on a different port.
92+
If you want to do that in any Spring Boot application, it should be sufficient *not* to include the `grpc-servlet-jakarta` dependency on your classpath.
93+
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.
94+
9095
[[server-interceptor]]
9196
== Server Interceptors
9297

spring-grpc-spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
{
3333
"name": "spring.grpc.server.servlet.enabled",
3434
"type": "java.lang.Boolean",
35-
"description": "Whether to use a servlet server in a servlet-based web application. When the value is false, a native gRPC server will be forced.",
35+
"description": "Whether to use a servlet server in a servlet-based web application. When the value is false, a native gRPC server will be created as long as one is available, and it will listen on its own port. Should only be needed if the GrpcServlet is on the classpath",
3636
"defaultValue": true
3737
},
3838
{

0 commit comments

Comments
 (0)