Skip to content

Commit a5904ab

Browse files
committed
Merge branch 'master' into support-AuthenticationManagerResolver
2 parents 18bd3e2 + de71ce3 commit a5904ab

File tree

13 files changed

+102
-43
lines changed

13 files changed

+102
-43
lines changed

README-zh-CN.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ README: [English](README.md) | [中文](README-zh-CN.md)
4040

4141
## 版本
4242

43-
最新版本是 `2.15.0.RELEASE` 它能跟 Spring-Boot `2.7.16` 和 Spring-Cloud `2021.0.8` 搭配使用。 但它也与各种其他版本兼容。 我们的 [文档](https://yidongnan.github.io/grpc-spring-boot-starter/en/versions.html) 中可以找到所有版本及其相应的库版本的概览。
43+
最新版本是 `3.0.0.RELEASE` 它能跟 Spring-Boot `3.2.2` 和 Spring-Cloud `2023.0.0` 搭配使用。 但它也与各种其他版本兼容。 我们的 [文档](https://yidongnan.github.io/grpc-spring-boot-starter/en/versions.html) 中可以找到所有版本及其相应的库版本的概览。
4444

4545
**注意:** 该项目也可以在没有 Spring-Boot 的情况下使用,但是您需要手动配置一些 bean。
4646

@@ -54,15 +54,15 @@ README: [English](README.md) | [中文](README-zh-CN.md)
5454
<dependency>
5555
<groupId>net.devh</groupId>
5656
<artifactId>grpc-spring-boot-starter</artifactId>
57-
<version>2.15.0.RELEASE</version>
57+
<version>3.0.0.RELEASE</version>
5858
</dependency>
5959
````
6060

6161
使用 Gradle 添加依赖:
6262

6363
````gradle
6464
dependencies {
65-
implementation 'net.devh:grpc-spring-boot-starter:2.15.0.RELEASE'
65+
implementation 'net.devh:grpc-spring-boot-starter:3.0.0.RELEASE'
6666
}
6767
````
6868

@@ -74,15 +74,15 @@ dependencies {
7474
<dependency>
7575
<groupId>net.devh</groupId>
7676
<artifactId>grpc-server-spring-boot-starter</artifactId>
77-
<version>2.15.0.RELEASE</version>
77+
<version>3.0.0.RELEASE</version>
7878
</dependency>
7979
````
8080

8181
使用 Gradle 添加依赖项:
8282

8383
````gradle
8484
dependencies {
85-
implementation 'net.devh:grpc-server-spring-boot-starter:2.15.0.RELEASE'
85+
implementation 'net.devh:grpc-server-spring-boot-starter:3.0.0.RELEASE'
8686
}
8787
````
8888

@@ -114,15 +114,15 @@ public class GrpcServerService extends GreeterGrpc.GreeterImplBase {
114114
<dependency>
115115
<groupId>net.devh</groupId>
116116
<artifactId>grpc-client-spring-boot-starter</artifactId>
117-
<version>2.15.0.RELEASE</version>
117+
<version>3.0.0.RELEASE</version>
118118
</dependency>
119119
````
120120

121121
使用 Gradle 添加依赖项:
122122

123123
````gradle
124124
dependencies {
125-
compile 'net.devh:grpc-client-spring-boot-starter:2.15.0.RELEASE'
125+
compile 'net.devh:grpc-client-spring-boot-starter:3.0.0.RELEASE'
126126
}
127127
````
128128

README.md

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# Survey - gRPC/Spring
2+
3+
Dear gRPC/Spring users, in order to enhance the user experience of
4+
grpc-ecosystem/grpc-spring, we have developed [this survey](https://docs.google.com/forms/d/e/1FAIpQLSfHgvh_Z0_wwX7JQLERanJ-AAXjiKh23_kSI3Rl5mnKVQ8Bpw/viewform?resourcekey=0-mEilI6lFvIfVXiUniEyCog) as a means of
5+
establishing a direct line of communication. Your feedback is highly appreciated.
6+
17
# gRPC Spring Boot Starter
28

39
[![Build master branch](https://github.com/grpc-ecosystem/grpc-spring/workflows/Build%20master%20branch/badge.svg)](https://github.com/grpc-ecosystem/grpc-spring/actions)
@@ -11,7 +17,7 @@
1117

1218
README: [English](README.md) | [中文](README-zh-CN.md)
1319

14-
**Documentation:** [English](https://yidongnan.github.io/grpc-spring-boot-starter/en/) | [中文](https://yidongnan.github.io/grpc-spring-boot-starter/zh-CN/)
20+
**Documentation:** [English](https://grpc-ecosystem.github.io/grpc-spring/en/) | [中文](https://grpc-ecosystem.github.io/grpc-spring/zh-CN/)
1521

1622
## Features
1723

@@ -50,7 +56,7 @@ README: [English](README.md) | [中文](README-zh-CN.md)
5056

5157
## Versions
5258

53-
The latest version is `2.15.0.RELEASE` it was compiled with spring-boot `2.7.16` and spring-cloud `2021.0.8`
59+
The latest version is `3.0.0.RELEASE` it was compiled with spring-boot `3.2.2` and spring-cloud `2023.0.0`
5460
but it is also compatible with a large variety of other versions.
5561
An overview of all versions and their respective library versions can be found in our [documentation](https://yidongnan.github.io/grpc-spring-boot-starter/en/versions.html).
5662

@@ -66,15 +72,15 @@ To add a dependency using Maven, use the following:
6672
<dependency>
6773
<groupId>net.devh</groupId>
6874
<artifactId>grpc-spring-boot-starter</artifactId>
69-
<version>2.15.0.RELEASE</version>
75+
<version>3.0.0.RELEASE</version>
7076
</dependency>
7177
````
7278

7379
To add a dependency using Gradle:
7480

7581
````gradle
7682
dependencies {
77-
implementation 'net.devh:grpc-spring-boot-starter:2.15.0.RELEASE'
83+
implementation 'net.devh:grpc-spring-boot-starter:3.0.0.RELEASE'
7884
}
7985
````
8086

@@ -86,15 +92,15 @@ To add a dependency using Maven, use the following:
8692
<dependency>
8793
<groupId>net.devh</groupId>
8894
<artifactId>grpc-server-spring-boot-starter</artifactId>
89-
<version>2.15.0.RELEASE</version>
95+
<version>3.0.0.RELEASE</version>
9096
</dependency>
9197
````
9298

9399
To add a dependency using Gradle:
94100

95101
````gradle
96102
dependencies {
97-
implementation 'net.devh:grpc-server-spring-boot-starter:2.15.0.RELEASE'
103+
implementation 'net.devh:grpc-server-spring-boot-starter:3.0.0.RELEASE'
98104
}
99105
````
100106

@@ -128,15 +134,15 @@ To add a dependency using Maven, use the following:
128134
<dependency>
129135
<groupId>net.devh</groupId>
130136
<artifactId>grpc-client-spring-boot-starter</artifactId>
131-
<version>2.15.0.RELEASE</version>
137+
<version>3.0.0.RELEASE</version>
132138
</dependency>
133139
````
134140

135141
To add a dependency using Gradle:
136142

137143
````gradle
138144
dependencies {
139-
compile 'net.devh:grpc-client-spring-boot-starter:2.15.0.RELEASE'
145+
compile 'net.devh:grpc-client-spring-boot-starter:3.0.0.RELEASE'
140146
}
141147
````
142148

build.gradle

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,30 @@ buildscript {
88
}
99
}
1010
ext {
11-
projectVersion = '3.0.0-SNAPSHOT'
11+
projectVersion = '3.0.0.RELEASE'
1212

1313
// https://github.com/grpc/grpc-java/releases
1414
grpcVersion = '1.60.1'
1515

1616
// https://github.com/google/guava/releases
17-
guavaVersion = '33.0.0-jre'
17+
guavaVersion = '33.1.0-jre'
1818
// https://github.com/protocolbuffers/protobuf/releases
19-
protobufVersion = '3.25.2'
19+
protobufVersion = '3.25.3'
2020
protobufGradlePluginVersion = '0.9.4'
2121

2222
// https://github.com/spring-projects/spring-boot/releases
23-
springBootVersion = '3.2.2'
23+
springBootVersion = '3.2.4'
2424
// https://github.com/spring-cloud/spring-cloud-release/releases
2525
springCloudVersion = '2023.0.0'
2626
// https://github.com/alibaba/spring-cloud-alibaba/releases
2727
springCloudAlibabaNacosVersion = '2022.0.0.0'
2828

29-
lombokPluginVersion = '8.4'
30-
versioningPluginVersion = '3.0.0'
29+
lombokPluginVersion = '8.6'
30+
versioningPluginVersion = '3.1.0'
3131
versionsPluginVersion = '0.51.0'
3232

3333
// https://github.com/JetBrains/kotlin/releases
34-
kotlinVersion = "1.9.22"
34+
kotlinVersion = "1.9.23"
3535
}
3636
}
3737

@@ -61,7 +61,7 @@ if (hasProperty('buildScan')) {
6161
wrapper {
6262
// Update using:
6363
// ./gradlew wrapper --gradle-version=8.4 --distribution-type=bin
64-
gradleVersion = '8.5'
64+
gradleVersion = '8.6'
6565
}
6666

6767
def buildTimeAndDate = OffsetDateTime.now()

docs/en/versions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Current version.
4949

5050
| Version | spring-boot | spring-cloud | gRPC | Date |
5151
|:-------:|:-----------:|:------------:|:------:|----------:|
52-
| 3.0.0\* | 3.1.4 | 2022.0.4 | 1.58.0 | Nov, 2023 |
52+
| 3.0.0 | 3.2.2 | 2023.0.0 | 1.60.1 | Feb, 2024 |
5353

5454
(\* Future versions)
5555

docs/zh-CN/versions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@
3838

3939
当前版本。
4040

41-
| 版本 | spring-boot | spring-cloud | gRPC | 日期 |
42-
|:------:|:-----------:|:------------:|:------:|---------:|
43-
| 3.0.0* | 3.1.4 | 2022.0.4 | 1.58.0 | 2023年9月 |
41+
| 版本 | spring-boot | spring-cloud | gRPC | 日期 |
42+
|:-----:|:-----------:|:------------:|:------:|--------:|
43+
| 3.0.0 | 3.2.2 | 2023.0.0 | 1.60.1 | 2024年2月 |
4444

4545
(\* 未来的版本)
4646

examples/grpc-observability/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ The backend microservice will
4545

4646
- listen on the TCP port 9091 for the gRPC calls from the frontend microservice.
4747
- listen on the TCP port 8081 for the Prometheus scrape requests.
48-
The frontend microservice will
48+
49+
The frontend microservice will
50+
4951
- send the unary/client streaming/server streaming/bidi streaming calls to the
5052
backend microservices via TCP port 9091.
5153
- listen on the TCP port 8080 for the Prometheus scrape requests.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew.bat

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
4343
%JAVA_EXE% -version >NUL 2>&1
4444
if %ERRORLEVEL% equ 0 goto execute
4545

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5151

5252
goto fail
5353

@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5757

5858
if exist "%JAVA_EXE%" goto execute
5959

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6565

6666
goto fail
6767

grpc-client-spring-boot-starter/src/main/java/net/devh/boot/grpc/client/channelfactory/AbstractChannelFactory.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ protected boolean isNonNullAndNonBlank(final String value) {
234234
}
235235

236236
/**
237-
* Configures limits such as max message sizes that should be used by the channel.
237+
* Configures limits such as max message or metadata sizes that should be used by the channel.
238238
*
239239
* @param builder The channel builder to configure.
240240
* @param name The name of the client to configure.
@@ -245,6 +245,10 @@ protected void configureLimits(final T builder, final String name) {
245245
if (maxInboundMessageSize != null) {
246246
builder.maxInboundMessageSize((int) maxInboundMessageSize.toBytes());
247247
}
248+
final DataSize maxInboundMetadataSize = properties.getMaxInboundMetadataSize();
249+
if (maxInboundMetadataSize != null) {
250+
builder.maxInboundMetadataSize((int) maxInboundMetadataSize.toBytes());
251+
}
248252
}
249253

250254
/**

grpc-client-spring-boot-starter/src/main/java/net/devh/boot/grpc/client/config/GrpcChannelProperties.java

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,43 @@ public void setMaxInboundMessageSize(final DataSize maxInboundMessageSize) {
333333
}
334334
}
335335

336+
@DataSizeUnit(DataUnit.BYTES)
337+
private DataSize maxInboundMetadataSize = null;
338+
339+
/**
340+
* Sets the maximum size of metadata in bytes allowed to be received. If not set ({@code null}) then it will default
341+
* to gRPC's default. The default is implementation-dependent, but is not generally less than 8 KiB and may be
342+
* unlimited. If set to {@code -1} then it will use the highest possible limit (not recommended). Integer.MAX_VALUE
343+
* disables the enforcement.
344+
*
345+
* @return The maximum size of metadata in bytes allowed to be received or null if the default should be used.
346+
*
347+
* @see ManagedChannelBuilder#maxInboundMetadataSize(int) (int)
348+
*/
349+
public DataSize getMaxInboundMetadataSize() {
350+
return maxInboundMetadataSize;
351+
}
352+
353+
/**
354+
* Sets the maximum size of metadata in bytes allowed to be received. If not set ({@code null}) then it will
355+
* default.The default is implementation-dependent, but is not generally less than 8 KiB and may be unlimited. If
356+
* set to {@code -1} then it will use the highest possible limit (not recommended). Integer.MAX_VALUE disables the
357+
* enforcement.
358+
*
359+
* @param maxInboundMetadataSize The new maximum size of metadata in bytes allowed to be received. {@code -1} for
360+
* max possible. Null to use the gRPC's default.
361+
*
362+
* @see ManagedChannelBuilder#maxInboundMetadataSize(int) (int)
363+
*/
364+
public void setMaxInboundMetadataSize(DataSize maxInboundMetadataSize) {
365+
if (maxInboundMetadataSize == null || maxInboundMetadataSize.toBytes() >= 0) {
366+
this.maxInboundMetadataSize = maxInboundMetadataSize;
367+
} else if (maxInboundMetadataSize.toBytes() == -1) {
368+
this.maxInboundMetadataSize = DataSize.ofBytes(Integer.MAX_VALUE);
369+
} else {
370+
throw new IllegalArgumentException("Unsupported maxInboundMetadataSize: " + maxInboundMetadataSize);
371+
}
372+
}
336373
// --------------------------------------------------
337374

338375
private Boolean fullStreamDecompression;

0 commit comments

Comments
 (0)