Skip to content

Commit f9c6b8c

Browse files
committed
Add grpc-server-netty-shaded sample back in.
Also updates grpc-server-kotlin sample but leaves disabled due to failing version compatibility in JVM. Signed-off-by: onobc <chris.bono@gmail.com>
1 parent fbaaeec commit f9c6b8c

File tree

7 files changed

+48
-46
lines changed

7 files changed

+48
-46
lines changed

samples/grpc-server-kotlin/build.gradle

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
2-
id 'java'
3-
id 'org.springframework.boot' version '3.5.5'
4-
id 'io.spring.dependency-management' version '1.1.6'
2+
id 'java'
3+
id 'org.springframework.boot' version '4.0.0-SNAPSHOT'
4+
id 'io.spring.dependency-management' version '1.1.7'
55
// id 'org.graalvm.buildtools.native' version '0.10.3'
66
id 'com.google.protobuf' version '0.9.4'
77
id 'org.jetbrains.kotlin.jvm' version '2.1.20'
@@ -35,16 +35,15 @@ dependencies {
3535

3636
implementation 'org.springframework.grpc:spring-grpc-spring-boot-starter'
3737
implementation 'org.springframework.boot:spring-boot-starter-actuator'
38-
implementation 'io.grpc:grpc-services'
39-
implementation "io.grpc:grpc-kotlin-stub:${kotlinStubVersion}"
40-
4138
implementation "org.jetbrains.kotlin:kotlin-reflect"
42-
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core'
39+
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core'
40+
implementation "io.grpc:grpc-kotlin-stub:${kotlinStubVersion}"
41+
42+
testImplementation 'org.springframework.grpc:spring-grpc-test-spring-boot-autoconfigure'
43+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
4344

44-
testImplementation 'org.springframework.boot:spring-boot-starter-test'
45-
testImplementation 'org.springframework.grpc:spring-grpc-test'
46-
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
47-
testRuntimeOnly "io.netty:netty-transport-native-epoll::linux-x86_64"
45+
testRuntimeOnly "io.netty:netty-transport-native-epoll::linux-x86_64"
46+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
4847
}
4948

5049
test {

samples/grpc-server-kotlin/pom.xml

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>3.5.5</version>
9+
<version>4.0.0-SNAPSHOT</version>
1010
<relativePath /> <!-- lookup parent from repository -->
1111
</parent>
1212
<groupId>org.springframework.grpc</groupId>
@@ -30,7 +30,7 @@
3030
<properties>
3131
<java.version>17</java.version>
3232
<spring-javaformat-maven-plugin.version>0.0.43</spring-javaformat-maven-plugin.version>
33-
<protobuf-java.version>4.31.1</protobuf-java.version>
33+
<protobuf-java.version>4.32.1</protobuf-java.version>
3434
<grpc.version>1.76.0</grpc.version>
3535
<grpc.kotlin.version>1.5.0</grpc.kotlin.version>
3636
<kotlin.version>1.9.22</kotlin.version>
@@ -51,6 +51,10 @@
5151
<groupId>org.springframework.grpc</groupId>
5252
<artifactId>spring-grpc-spring-boot-starter</artifactId>
5353
</dependency>
54+
<dependency>
55+
<groupId>org.springframework.boot</groupId>
56+
<artifactId>spring-boot-starter-actuator</artifactId>
57+
</dependency>
5458
<dependency>
5559
<groupId>org.jetbrains.kotlinx</groupId>
5660
<artifactId>kotlinx-coroutines-core</artifactId>
@@ -60,27 +64,24 @@
6064
<artifactId>grpc-kotlin-stub</artifactId>
6165
<version>${grpc.kotlin.version}</version>
6266
</dependency>
67+
6368
<dependency>
64-
<groupId>io.grpc</groupId>
65-
<artifactId>grpc-services</artifactId>
69+
<groupId>org.springframework.grpc</groupId>
70+
<artifactId>spring-grpc-test-spring-boot-autoconfigure</artifactId>
71+
<scope>test</scope>
6672
</dependency>
6773
<dependency>
6874
<groupId>org.springframework.boot</groupId>
69-
<artifactId>spring-boot-starter-actuator</artifactId>
75+
<artifactId>spring-boot-starter-test</artifactId>
76+
<scope>test</scope>
7077
</dependency>
71-
7278
<dependency>
7379
<!-- for testing unix domain sockets -->
7480
<groupId>io.netty</groupId>
7581
<artifactId>netty-transport-native-epoll</artifactId>
7682
<classifier>linux-x86_64</classifier>
7783
<scope>test</scope>
7884
</dependency>
79-
<dependency>
80-
<groupId>org.springframework.grpc</groupId>
81-
<artifactId>spring-grpc-test</artifactId>
82-
<scope>test</scope>
83-
</dependency>
8485
</dependencies>
8586

8687
<build>

samples/grpc-server-netty-shaded/build.gradle

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
plugins {
2-
id 'java'
3-
id 'org.springframework.boot' version '3.5.5'
4-
id 'io.spring.dependency-management' version '1.1.6'
2+
id 'java'
3+
id 'org.springframework.boot' version '4.0.0-RC1'
4+
id 'io.spring.dependency-management' version '1.1.7'
55
id 'org.graalvm.buildtools.native' version '0.10.3'
66
id 'com.google.protobuf' version '0.9.4'
77
}
@@ -29,16 +29,17 @@ dependencyManagement {
2929

3030
dependencies {
3131
implementation 'org.springframework.grpc:spring-grpc-spring-boot-starter'
32-
implementation 'io.grpc:grpc-netty-shaded'
33-
implementation 'io.grpc:grpc-services'
34-
modules {
35-
module("io.grpc:grpc-netty") {
36-
replacedBy("io.grpc:grpc-netty-shaded", "Use Netty shaded instead of regular Netty")
37-
}
38-
}
39-
testImplementation 'org.springframework.boot:spring-boot-starter-test'
40-
testImplementation 'org.springframework.grpc:spring-grpc-test'
41-
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
32+
implementation 'io.grpc:grpc-netty-shaded'
33+
modules {
34+
module("io.grpc:grpc-netty") {
35+
replacedBy("io.grpc:grpc-netty-shaded", "Use Netty shaded instead of regular Netty")
36+
}
37+
}
38+
39+
testImplementation 'org.springframework.grpc:spring-grpc-test-spring-boot-autoconfigure'
40+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
41+
42+
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
4243
}
4344

4445
test {

samples/grpc-server-netty-shaded/pom.xml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<parent>
77
<groupId>org.springframework.boot</groupId>
88
<artifactId>spring-boot-starter-parent</artifactId>
9-
<version>3.5.5</version>
9+
<version>4.0.0-RC1</version>
1010
<relativePath /> <!-- lookup parent from repository -->
1111
</parent>
1212
<groupId>com.example</groupId>
@@ -17,7 +17,7 @@
1717
<properties>
1818
<java.version>17</java.version>
1919
<spring-javaformat-maven-plugin.version>0.0.43</spring-javaformat-maven-plugin.version>
20-
<protobuf-java.version>4.31.1</protobuf-java.version>
20+
<protobuf-java.version>4.32.1</protobuf-java.version>
2121
<grpc.version>1.76.0</grpc.version>
2222
</properties>
2323
<dependencyManagement>
@@ -46,19 +46,20 @@
4646
<groupId>io.grpc</groupId>
4747
<artifactId>grpc-netty-shaded</artifactId>
4848
</dependency>
49+
4950
<dependency>
50-
<groupId>io.grpc</groupId>
51-
<artifactId>grpc-services</artifactId>
51+
<groupId>org.springframework.grpc</groupId>
52+
<artifactId>spring-grpc-test-spring-boot-autoconfigure</artifactId>
53+
<scope>test</scope>
5254
</dependency>
53-
5455
<dependency>
5556
<groupId>org.springframework.boot</groupId>
56-
<artifactId>spring-boot-devtools</artifactId>
57+
<artifactId>spring-boot-starter-test</artifactId>
5758
<scope>test</scope>
5859
</dependency>
5960
<dependency>
60-
<groupId>org.springframework.grpc</groupId>
61-
<artifactId>spring-grpc-test</artifactId>
61+
<groupId>org.springframework.boot</groupId>
62+
<artifactId>spring-boot-devtools</artifactId>
6263
<scope>test</scope>
6364
</dependency>
6465
</dependencies>

samples/grpc-server-netty-shaded/src/test/java/com/example/demo/DemoApplicationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,12 @@
77
import org.junit.jupiter.api.Test;
88
import org.springframework.beans.factory.annotation.Autowired;
99
import org.springframework.boot.SpringApplication;
10+
import org.springframework.boot.grpc.test.autoconfigure.LocalGrpcPort;
1011
import org.springframework.boot.test.context.SpringBootTest;
1112
import org.springframework.boot.test.context.TestConfiguration;
1213
import org.springframework.context.annotation.Bean;
1314
import org.springframework.context.annotation.Lazy;
1415
import org.springframework.grpc.client.GrpcChannelFactory;
15-
import org.springframework.grpc.test.LocalGrpcPort;
1616
import org.springframework.test.annotation.DirtiesContext;
1717

1818
import com.example.demo.proto.HelloReply;

samples/grpc-server/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
<groupId>io.grpc</groupId>
7070
<artifactId>grpc-inprocess</artifactId>
7171
<scope>test</scope>
72-
</dependency>
72+
</dependency>
7373
<dependency>
7474
<!-- for testing unix domain sockets -->
7575
<groupId>io.netty</groupId>

samples/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<module>grpc-secure</module>
2323
<module>grpc-server</module>
2424
<!-- <module>grpc-server-kotlin</module>-->
25-
<!-- <module>grpc-server-netty-shaded</module>-->
25+
<module>grpc-server-netty-shaded</module>
2626
<!-- <module>grpc-tomcat</module>-->
2727
<!-- <module>grpc-tomcat-secure</module>-->
2828
<!-- <module>grpc-webflux</module>-->

0 commit comments

Comments
 (0)