From 2a7ea42d24941b18253e792074ce8036169ed638 Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Fri, 20 Mar 2026 17:08:16 -0400 Subject: [PATCH 1/4] Update Spring grpc to 1.1.0-SNAPSHOT --- basic/grpc-client/pom.xml | 16 +++++----------- .../grpc/client/GrpcClientConfiguration.java | 6 +++++- .../samples/grpc/client/GrpcClientTests.java | 4 +++- build.gradle | 8 +++----- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/basic/grpc-client/pom.xml b/basic/grpc-client/pom.xml index 5c4ce3fb8..1ba056089 100644 --- a/basic/grpc-client/pom.xml +++ b/basic/grpc-client/pom.xml @@ -65,7 +65,7 @@ org.springframework.grpc spring-grpc-dependencies - 1.0.2 + 1.1.0-SNAPSHOT pom import @@ -335,8 +335,8 @@ runtime - org.springframework.grpc - spring-grpc-client-spring-boot-starter + org.springframework.boot + spring-boot-starter-grpc-client runtime @@ -344,12 +344,6 @@ spring-integration-grpc runtime - - com.google.protobuf - protobuf-java - 4.29.4 - runtime - org.hamcrest hamcrest-library @@ -378,8 +372,8 @@ test - org.springframework.grpc - spring-grpc-test + org.springframework.boot + spring-boot-starter-grpc-test test diff --git a/basic/grpc-client/src/main/java/org/springframework/integration/samples/grpc/client/GrpcClientConfiguration.java b/basic/grpc-client/src/main/java/org/springframework/integration/samples/grpc/client/GrpcClientConfiguration.java index 9e109ce05..81a5702b4 100644 --- a/basic/grpc-client/src/main/java/org/springframework/integration/samples/grpc/client/GrpcClientConfiguration.java +++ b/basic/grpc-client/src/main/java/org/springframework/integration/samples/grpc/client/GrpcClientConfiguration.java @@ -23,6 +23,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; +import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.ApplicationRunner; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -46,9 +47,12 @@ public class GrpcClientConfiguration { private static final Log LOGGER = LogFactory.getLog(GrpcClientConfiguration.class); + @Value("${spring.grpc.client.channels.spring-integration.address}") + private String grpcServerAddress; + @Bean ManagedChannel managedChannel(GrpcChannelFactory factory) { - return factory.createChannel("spring-integration"); + return factory.createChannel(this.grpcServerAddress); } /** diff --git a/basic/grpc-client/src/test/java/org/springframework/integration/samples/grpc/client/GrpcClientTests.java b/basic/grpc-client/src/test/java/org/springframework/integration/samples/grpc/client/GrpcClientTests.java index 2d479852b..57b41ce96 100644 --- a/basic/grpc-client/src/test/java/org/springframework/integration/samples/grpc/client/GrpcClientTests.java +++ b/basic/grpc-client/src/test/java/org/springframework/integration/samples/grpc/client/GrpcClientTests.java @@ -38,7 +38,9 @@ */ @SpringBootTest(properties = { "spring.grpc.test.inprocess.enabled=true", - "spring.grpc.test.inprocess.exclusive=true" + "spring.grpc.test.inprocess.exclusive=true", + "spring.grpc.server.inprocess.name=test", + "spring.grpc.client.channels.spring-integration.address=in-process:test" }) @DirtiesContext @ExtendWith(OutputCaptureExtension.class) diff --git a/build.gradle b/build.gradle index f33135521..262a9a949 100644 --- a/build.gradle +++ b/build.gradle @@ -330,7 +330,7 @@ subprojects { subproject -> protobufVersion = '4.29.4' slf4jVersion = '2.0.17' springCloudVersion = '2025.1.0' - springGrpc = '1.0.2' + springGrpc = '1.1.0-SNAPSHOT' springIntegrationVersion = '7.1.0-SNAPSHOT' set('spring-integration.version', "$springIntegrationVersion") springIntegrationSocialTwiterVersion = '1.0.1.BUILD-SNAPSHOT' @@ -889,14 +889,12 @@ project('grpc-client') { dependencies { implementation platform("org.springframework.grpc:spring-grpc-dependencies:$springGrpc") implementation 'org.springframework.boot:spring-boot-starter-integration' - implementation "org.springframework.grpc:spring-grpc-client-spring-boot-starter" + implementation "org.springframework.boot:spring-boot-starter-grpc-client" implementation 'org.springframework.integration:spring-integration-grpc' - implementation("com.google.protobuf:protobuf-java:$protobufVersion") - //Test testImplementation 'org.springframework.boot:spring-boot-starter-test' - testImplementation "org.springframework.grpc:spring-grpc-test" + testImplementation "org.springframework.boot:spring-boot-starter-grpc-test" configurations { testRuntimeOnly.exclude group: 'io.grpc', module: 'grpc-netty' From d3119f628a0c914a3d6fc56aa22b8c30b0983633 Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Mon, 23 Mar 2026 12:11:30 -0400 Subject: [PATCH 2/4] Update based on code review - Removed redundant dependencies - Removed unused properties --- basic/grpc-client/pom.xml | 120 ++++++++---------- .../samples/grpc/client/GrpcClientTests.java | 2 - build.gradle | 2 - 3 files changed, 54 insertions(+), 70 deletions(-) diff --git a/basic/grpc-client/pom.xml b/basic/grpc-client/pom.xml index 1ba056089..3fdea18a3 100644 --- a/basic/grpc-client/pom.xml +++ b/basic/grpc-client/pom.xml @@ -60,15 +60,62 @@ GitHub https://github.com/spring-projects/spring-integration-samples/issues + + + org.springframework.boot + spring-boot-starter-integration + runtime + + + org.springframework.boot + spring-boot-starter-grpc-client + runtime + + + org.springframework.integration + spring-integration-grpc + runtime + + + org.hamcrest + hamcrest-library + 2.2 + test + + + org.mockito + mockito-core + 5.21.0 + test + + + org.junit.jupiter + junit-jupiter-api + test + + + org.springframework.integration + spring-integration-test + test + + + org.springframework.boot + spring-boot-starter-grpc-test + test + + + org.junit.jupiter + junit-jupiter-engine + runtime + + + org.junit.platform + junit-platform-launcher + runtime + + - - org.springframework.grpc - spring-grpc-dependencies - 1.1.0-SNAPSHOT - pom - import - org.springframework.integration spring-integration-jdbc @@ -328,65 +375,6 @@ - - - org.springframework.boot - spring-boot-starter-integration - runtime - - - org.springframework.boot - spring-boot-starter-grpc-client - runtime - - - org.springframework.integration - spring-integration-grpc - runtime - - - org.hamcrest - hamcrest-library - 2.2 - test - - - org.mockito - mockito-core - 5.21.0 - test - - - org.junit.jupiter - junit-jupiter-api - test - - - org.springframework.integration - spring-integration-test - test - - - org.springframework.boot - spring-boot-starter-test - test - - - org.springframework.boot - spring-boot-starter-grpc-test - test - - - org.junit.jupiter - junit-jupiter-engine - runtime - - - org.junit.platform - junit-platform-launcher - runtime - - 17 diff --git a/basic/grpc-client/src/test/java/org/springframework/integration/samples/grpc/client/GrpcClientTests.java b/basic/grpc-client/src/test/java/org/springframework/integration/samples/grpc/client/GrpcClientTests.java index 57b41ce96..721ac33ed 100644 --- a/basic/grpc-client/src/test/java/org/springframework/integration/samples/grpc/client/GrpcClientTests.java +++ b/basic/grpc-client/src/test/java/org/springframework/integration/samples/grpc/client/GrpcClientTests.java @@ -37,8 +37,6 @@ * @author Glenn Renfro */ @SpringBootTest(properties = { - "spring.grpc.test.inprocess.enabled=true", - "spring.grpc.test.inprocess.exclusive=true", "spring.grpc.server.inprocess.name=test", "spring.grpc.client.channels.spring-integration.address=in-process:test" }) diff --git a/build.gradle b/build.gradle index 262a9a949..d931188e4 100644 --- a/build.gradle +++ b/build.gradle @@ -887,13 +887,11 @@ project('grpc-client') { apply plugin: 'com.google.protobuf' dependencies { - implementation platform("org.springframework.grpc:spring-grpc-dependencies:$springGrpc") implementation 'org.springframework.boot:spring-boot-starter-integration' implementation "org.springframework.boot:spring-boot-starter-grpc-client" implementation 'org.springframework.integration:spring-integration-grpc' //Test - testImplementation 'org.springframework.boot:spring-boot-starter-test' testImplementation "org.springframework.boot:spring-boot-starter-grpc-test" configurations { From 90b91ba21579255562c271ca1b7cbdb0680b7c21 Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Mon, 23 Mar 2026 13:15:17 -0400 Subject: [PATCH 3/4] Remove unused version from build.gradle - localized the server port `@value` --- .../samples/grpc/client/GrpcClientConfiguration.java | 8 +++----- build.gradle | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/basic/grpc-client/src/main/java/org/springframework/integration/samples/grpc/client/GrpcClientConfiguration.java b/basic/grpc-client/src/main/java/org/springframework/integration/samples/grpc/client/GrpcClientConfiguration.java index 81a5702b4..bc6ada276 100644 --- a/basic/grpc-client/src/main/java/org/springframework/integration/samples/grpc/client/GrpcClientConfiguration.java +++ b/basic/grpc-client/src/main/java/org/springframework/integration/samples/grpc/client/GrpcClientConfiguration.java @@ -47,12 +47,10 @@ public class GrpcClientConfiguration { private static final Log LOGGER = LogFactory.getLog(GrpcClientConfiguration.class); - @Value("${spring.grpc.client.channels.spring-integration.address}") - private String grpcServerAddress; - @Bean - ManagedChannel managedChannel(GrpcChannelFactory factory) { - return factory.createChannel(this.grpcServerAddress); + ManagedChannel managedChannel(GrpcChannelFactory factory, @Value("${spring.grpc.client.channels" + + ".spring-integration.address}") String grpcServerAddress) { + return factory.createChannel(grpcServerAddress); } /** diff --git a/build.gradle b/build.gradle index d931188e4..252742506 100644 --- a/build.gradle +++ b/build.gradle @@ -330,7 +330,6 @@ subprojects { subproject -> protobufVersion = '4.29.4' slf4jVersion = '2.0.17' springCloudVersion = '2025.1.0' - springGrpc = '1.1.0-SNAPSHOT' springIntegrationVersion = '7.1.0-SNAPSHOT' set('spring-integration.version', "$springIntegrationVersion") springIntegrationSocialTwiterVersion = '1.0.1.BUILD-SNAPSHOT' From 64442d2d57feb19996ad1d98ce6aa5e8a3587e61 Mon Sep 17 00:00:00 2001 From: Glenn Renfro Date: Mon, 23 Mar 2026 18:36:01 -0400 Subject: [PATCH 4/4] Merge grpServerAddress param def into single line --- .../samples/grpc/client/GrpcClientConfiguration.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basic/grpc-client/src/main/java/org/springframework/integration/samples/grpc/client/GrpcClientConfiguration.java b/basic/grpc-client/src/main/java/org/springframework/integration/samples/grpc/client/GrpcClientConfiguration.java index bc6ada276..13059cfa4 100644 --- a/basic/grpc-client/src/main/java/org/springframework/integration/samples/grpc/client/GrpcClientConfiguration.java +++ b/basic/grpc-client/src/main/java/org/springframework/integration/samples/grpc/client/GrpcClientConfiguration.java @@ -48,8 +48,8 @@ public class GrpcClientConfiguration { private static final Log LOGGER = LogFactory.getLog(GrpcClientConfiguration.class); @Bean - ManagedChannel managedChannel(GrpcChannelFactory factory, @Value("${spring.grpc.client.channels" + - ".spring-integration.address}") String grpcServerAddress) { + ManagedChannel managedChannel(GrpcChannelFactory factory, + @Value("${spring.grpc.client.channels.spring-integration.address}") String grpcServerAddress) { return factory.createChannel(grpcServerAddress); }