diff --git a/pom.xml b/pom.xml
index f0c41fb4..bc9a5f39 100644
--- a/pom.xml
+++ b/pom.xml
@@ -20,6 +20,9 @@
spring-grpc-test
spring-grpc-spring-boot-autoconfigure
spring-grpc-spring-boot-starter
+ spring-grpc-client-spring-boot-starter
+ spring-grpc-server-spring-boot-starter
+ spring-grpc-server-web-spring-boot-starter
samples
diff --git a/samples/grpc-tomcat-secure/pom.xml b/samples/grpc-tomcat-secure/pom.xml
index 97b70563..18ece229 100644
--- a/samples/grpc-tomcat-secure/pom.xml
+++ b/samples/grpc-tomcat-secure/pom.xml
@@ -47,11 +47,7 @@
org.springframework.grpc
- spring-grpc-spring-boot-starter
-
-
- org.springframework.boot
- spring-boot-starter-web
+ spring-grpc-server-web-spring-boot-starter
org.springframework.boot
@@ -61,10 +57,6 @@
io.grpc
grpc-services
-
- io.grpc
- grpc-servlet-jakarta
-
org.springframework.grpc
spring-grpc-test
@@ -180,4 +172,4 @@
-
\ No newline at end of file
+
diff --git a/samples/grpc-tomcat/pom.xml b/samples/grpc-tomcat/pom.xml
index 1255c840..faf19adb 100644
--- a/samples/grpc-tomcat/pom.xml
+++ b/samples/grpc-tomcat/pom.xml
@@ -47,20 +47,12 @@
org.springframework.grpc
- spring-grpc-spring-boot-starter
-
-
- org.springframework.boot
- spring-boot-starter-web
+ spring-grpc-server-web-spring-boot-starter
io.grpc
grpc-services
-
- io.grpc
- grpc-servlet-jakarta
-
org.springframework.boot
spring-boot-starter-actuator
@@ -185,4 +177,4 @@
-
\ No newline at end of file
+
diff --git a/spring-grpc-client-spring-boot-starter/pom.xml b/spring-grpc-client-spring-boot-starter/pom.xml
new file mode 100644
index 00000000..1fcaced4
--- /dev/null
+++ b/spring-grpc-client-spring-boot-starter/pom.xml
@@ -0,0 +1,42 @@
+
+
+ 4.0.0
+
+ org.springframework.grpc
+ spring-grpc
+ 0.4.0-SNAPSHOT
+
+ spring-grpc-client-spring-boot-starter
+ jar
+ Spring gRPC Client Spring Boot Starter
+ Spring gRPC Client Spring Boot Starter
+
+
+
+ org.springframework.grpc
+ spring-grpc-core
+ ${project.version}
+
+
+ org.springframework.grpc
+ spring-grpc-spring-boot-autoconfigure
+ ${project.version}
+
+
+ io.grpc
+ grpc-netty
+
+
+ io.grpc
+ grpc-stub
+
+
+ org.springframework.boot
+ spring-boot-starter
+ ${spring-boot.version}
+
+
+
+
diff --git a/spring-grpc-core/pom.xml b/spring-grpc-core/pom.xml
index b83ebcf0..02a9d04a 100644
--- a/spring-grpc-core/pom.xml
+++ b/spring-grpc-core/pom.xml
@@ -32,6 +32,15 @@
spring-security-web
true
+
+ io.grpc
+ grpc-core
+
+
+ io.grpc
+ grpc-stub
+ true
+
org.springframework.security
spring-security-oauth2-resource-server
@@ -50,6 +59,7 @@
io.grpc
grpc-netty
+ true
io.grpc
@@ -83,12 +93,6 @@
com.google.api.grpc
proto-google-common-protos
-
-
- io.grpc
- grpc-stub
-
-
org.springframework.boot
spring-boot-starter-test
diff --git a/spring-grpc-dependencies/pom.xml b/spring-grpc-dependencies/pom.xml
index 174d2623..a186149d 100644
--- a/spring-grpc-dependencies/pom.xml
+++ b/spring-grpc-dependencies/pom.xml
@@ -75,6 +75,21 @@
spring-grpc-spring-boot-starter
${project.version}
+
+ org.springframework.grpc
+ spring-grpc-client-spring-boot-starter
+ ${project.version}
+
+
+ org.springframework.grpc
+ spring-grpc-server-spring-boot-starter
+ ${project.version}
+
+
+ org.springframework.grpc
+ spring-grpc-server-web-spring-boot-starter
+ ${project.version}
+
org.springframework.grpc
diff --git a/spring-grpc-docs/src/main/antora/modules/ROOT/pages/server.adoc b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/server.adoc
index 7e0cc3f9..231b4b01 100644
--- a/spring-grpc-docs/src/main/antora/modules/ROOT/pages/server.adoc
+++ b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/server.adoc
@@ -59,21 +59,15 @@ dependencies {
== Servlet Server
Any servlet container can be used to run a gRPC server.
-Spring gRPC includes autoconfiguration that configures the server to use the servlet container if it detects that it is in a web application, so all you have to do is include `spring-boot-starter-web` and the `grpc-servlet` dependnecy in your application.
+Spring gRPC includes autoconfiguration that configures the server to use the servlet container if it detects that it is in a web application.
+Spring gRPC also provides a convenience starter that includes the required dependencies (`spring-boot-starter-web` and the `grpc-servlet-jakarta`) for this scenario.
+So all you have to do is include the `spring-boot-starter-web` dependency as follows:
[source,xml]
----
-
- org.springframework.boot
- spring-boot-starter-web
-
org.springframework.grpc
- spring-grpc-spring-boot-starter
-
-
- io.grpc
- grpc-servlet-jakarta
+ spring-grpc-server-web-spring-boot-starter
----
@@ -82,9 +76,7 @@ For Gradle users
[source,gradle]
----
dependencies {
- implementation "org.springframework.boot:spring-boot-starter-web"
- implementation "org.springframework.grpc:spring-grpc-spring-boot-starter"
- implementation "io.grpc:grpc-servlet-jakarta"
+ implementation "org.springframework.grpc:spring-grpc-server-web-spring-boot-starter"
}
----
diff --git a/spring-grpc-docs/src/main/antora/modules/ROOT/pages/whats-new.adoc b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/whats-new.adoc
index f595b5ec..ff49dba1 100644
--- a/spring-grpc-docs/src/main/antora/modules/ROOT/pages/whats-new.adoc
+++ b/spring-grpc-docs/src/main/antora/modules/ROOT/pages/whats-new.adoc
@@ -5,27 +5,13 @@
[[what-s-new-in-0-4-0-since-0-3-0]]
== What's New in 0.4.0 Since 0.3.0
-This section covers the changes made from version 0.2.0 to version 0.3.0.
+This section covers the changes made from version 0.3.0 to version 0.4.0.
-=== Channel Factory
-The `GrpcChannelFactory` has a new interface and its methods now return a `Channel` (instead of a `ChannelBuilder`).
-The `createChannel()` method is overloaded with a new method that accepts a `ChannelBuilderOptions` which can be used to configure the channel before it is created.
+=== Fine-grained starter modules
+The following fine-grained Spring Boot starter modules have been added:
-=== Client Side Observability
-A gRPC client will generate a new span for each RPC call. The span will be automatically closed when the call is completed.
+- `spring-grpc-client-spring-boot-starter` provides Netty gRPC client
+- `spring-grpc-server-spring-boot-starter` provides Netty gRPC server
+- `spring-grpc-server-spring-boot-starter` provides Servlet gRPC server
-=== Security in Servlet Containers
-Spring Security works with gRPC servers running in servlet containers. You can use all your favourite Spring Security features to secure your gRPC services.
-
-[[what-s-new-in-0-3-0-since-0-2-0]]
-== What's New in 0.3.0 Since 0.2.0
-
-This section covers the changes made from version 0.2.0 to version 0.3.0.
-
-=== Client Interceptors
-You can now add xref:client.adoc#client-interceptor[Client Interceptors] to created gRPC channels.
-
-=== Breaking Changes
-
-==== GrpcChannelConfigurer renamed
-The `GrpcChannelConfigurer` has been renamed to `GrpcChannelBuilderCustomizer` to more accurately represent its purpose and be consistent with the server-side terminology.
+The current coarse-grained starter `spring-grpc-spring-boot-starter` still provides Netty gRPC server and client.
diff --git a/spring-grpc-docs/src/main/antora/modules/ROOT/partials/_configprops.adoc b/spring-grpc-docs/src/main/antora/modules/ROOT/partials/_configprops.adoc
index 5cdde9f6..caa58deb 100644
--- a/spring-grpc-docs/src/main/antora/modules/ROOT/partials/_configprops.adoc
+++ b/spring-grpc-docs/src/main/antora/modules/ROOT/partials/_configprops.adoc
@@ -41,7 +41,7 @@
|spring.grpc.server.port | `+++9090+++` | Server port to listen on. When the value is 0, a random available port is selected. The default is 9090.
|spring.grpc.server.reflection.enabled | `+++true+++` | Whether to enable Reflection on the gRPC server.
|spring.grpc.server.security.csrf.enabled | `+++false+++` | Whether to enable CSRF protection on gRPC requests.
-|spring.grpc.server.servlet.enabled | `+++true+++` | Whether to use a servlet server in a servlet-based web application (set to false to force a native gRPC server).
+|spring.grpc.server.servlet.enabled | `+++true+++` | Whether to use a servlet server in a servlet-based web application. When the value is false, a native gRPC server will be forced.
|spring.grpc.server.shutdown-grace-period | `+++30s+++` | Maximum time to wait for the server to gracefully shutdown. When the value is negative, the server waits forever. When the value is 0, the server will force shutdown immediately. The default is 30 seconds.
|spring.grpc.server.ssl.bundle | | SSL bundle name.
|spring.grpc.server.ssl.client-auth | `+++none+++` | Client authentication mode.
diff --git a/spring-grpc-server-spring-boot-starter/pom.xml b/spring-grpc-server-spring-boot-starter/pom.xml
new file mode 100644
index 00000000..379b0854
--- /dev/null
+++ b/spring-grpc-server-spring-boot-starter/pom.xml
@@ -0,0 +1,43 @@
+
+
+ 4.0.0
+
+ org.springframework.grpc
+ spring-grpc
+ 0.4.0-SNAPSHOT
+
+ spring-grpc-server-spring-boot-starter
+ jar
+ Spring gRPC Server (Netty) Spring Boot Starter
+ Spring gRPC Server (Netty) Spring Boot Starter
+
+
+
+ org.springframework.grpc
+ spring-grpc-core
+ ${project.version}
+
+
+ org.springframework.grpc
+ spring-grpc-spring-boot-autoconfigure
+ ${project.version}
+
+
+ io.grpc
+ grpc-netty
+
+
+ io.grpc
+ grpc-services
+ true
+
+
+ org.springframework.boot
+ spring-boot-starter
+ ${spring-boot.version}
+
+
+
+
diff --git a/spring-grpc-server-web-spring-boot-starter/pom.xml b/spring-grpc-server-web-spring-boot-starter/pom.xml
new file mode 100644
index 00000000..babe1d1a
--- /dev/null
+++ b/spring-grpc-server-web-spring-boot-starter/pom.xml
@@ -0,0 +1,32 @@
+
+
+ 4.0.0
+
+ org.springframework.grpc
+ spring-grpc
+ 0.4.0-SNAPSHOT
+
+ spring-grpc-server-web-spring-boot-starter
+ jar
+ Spring gRPC Servlet Server Spring Boot Starter
+ Spring gRPC Servlet Server Spring Boot Starter
+
+
+
+ org.springframework.grpc
+ spring-grpc-spring-boot-starter
+
+
+ io.grpc
+ grpc-servlet-jakarta
+
+
+ org.springframework.boot
+ spring-boot-starter-web
+ ${spring-boot.version}
+
+
+
+
diff --git a/spring-grpc-spring-boot-autoconfigure/pom.xml b/spring-grpc-spring-boot-autoconfigure/pom.xml
index 96c2fcae..30f7ec83 100644
--- a/spring-grpc-spring-boot-autoconfigure/pom.xml
+++ b/spring-grpc-spring-boot-autoconfigure/pom.xml
@@ -51,6 +51,7 @@
org.springframework.grpc
spring-grpc-core
${project.version}
+ true
org.springframework
@@ -72,6 +73,16 @@
grpc-services
true
+
+ io.grpc
+ grpc-stub
+ true
+
+
+ io.grpc
+ grpc-netty
+ true
+
io.grpc
grpc-netty-shaded
diff --git a/spring-grpc-spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/spring-grpc-spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
index 594003bd..ea65bdab 100644
--- a/spring-grpc-spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
+++ b/spring-grpc-spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
@@ -26,7 +26,7 @@
{
"name": "spring.grpc.server.servlet.enabled",
"type": "java.lang.Boolean",
- "description": "Whether to use a servlet server in a servlet-based web application (set to false to force a native gRPC server).",
+ "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.",
"defaultValue": true
},
{
diff --git a/spring-grpc-spring-boot-starter/pom.xml b/spring-grpc-spring-boot-starter/pom.xml
index 42b5ff93..03b5db13 100644
--- a/spring-grpc-spring-boot-starter/pom.xml
+++ b/spring-grpc-spring-boot-starter/pom.xml
@@ -10,24 +10,17 @@
spring-grpc-spring-boot-starter
jar
- Spring gRPC Spring Boot Starter
- Spring gRPC Spring Boot Starter
+ Spring gRPC Server and Client Spring Boot Starter
+ Spring gRPC Server and Client Spring Boot Starter
org.springframework.grpc
- spring-grpc-core
- ${project.version}
+ spring-grpc-client-spring-boot-starter
org.springframework.grpc
- spring-grpc-spring-boot-autoconfigure
- ${project.version}
-
-
- org.springframework.boot
- spring-boot-starter
- ${spring-boot.version}
+ spring-grpc-server-spring-boot-starter
diff --git a/spring-grpc-test/pom.xml b/spring-grpc-test/pom.xml
index 428523ac..0da560e3 100644
--- a/spring-grpc-test/pom.xml
+++ b/spring-grpc-test/pom.xml
@@ -25,6 +25,11 @@
+
+ org.springframework.grpc
+ spring-grpc-core
+ ${project.version}
+
org.springframework.grpc
spring-grpc-spring-boot-autoconfigure
@@ -39,6 +44,11 @@
io.grpc
grpc-testing
+
+ io.grpc
+ grpc-netty
+ true
+
io.grpc
grpc-inprocess