Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
126 changes: 54 additions & 72 deletions basic/grpc-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,62 @@
<system>GitHub</system>
<url>https://github.com/spring-projects/spring-integration-samples/issues</url>
</issueManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc-client</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-grpc</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.21.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-grpc-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-dependencies</artifactId>
<version>1.0.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-jdbc</artifactId>
Expand Down Expand Up @@ -328,71 +375,6 @@
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-integration</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-client-spring-boot-starter</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-grpc</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>com.google.protobuf</groupId>
<artifactId>protobuf-java</artifactId>
<version>4.29.4</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-library</artifactId>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>5.21.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.integration</groupId>
<artifactId>spring-integration-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.grpc</groupId>
<artifactId>spring-grpc-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<scope>runtime</scope>
</dependency>
</dependencies>
<properties>
<java.version>17</java.version>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -47,8 +48,9 @@ public class GrpcClientConfiguration {
private static final Log LOGGER = LogFactory.getLog(GrpcClientConfiguration.class);

@Bean
ManagedChannel managedChannel(GrpcChannelFactory factory) {
return factory.createChannel("spring-integration");
ManagedChannel managedChannel(GrpcChannelFactory factory,
@Value("${spring.grpc.client.channels.spring-integration.address}") String grpcServerAddress) {
return factory.createChannel(grpcServerAddress);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
* @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"
})
@DirtiesContext
@ExtendWith(OutputCaptureExtension.class)
Expand Down
9 changes: 2 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,6 @@ subprojects { subproject ->
protobufVersion = '4.29.4'
slf4jVersion = '2.0.17'
springCloudVersion = '2025.1.0'
springGrpc = '1.0.2'
springIntegrationVersion = '7.1.0-SNAPSHOT'
set('spring-integration.version', "$springIntegrationVersion")
springIntegrationSocialTwiterVersion = '1.0.1.BUILD-SNAPSHOT'
Expand Down Expand Up @@ -887,16 +886,12 @@ 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.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'
Expand Down
Loading