From cdbf74fc3a6a04776fb3db1d0a162bca4d577bf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Nicoll?= Date: Fri, 3 Apr 2026 12:33:35 +0200 Subject: [PATCH] Document missing duration unit in GrpcClientProperties See gh-49722 Closes gh-49879 --- .../client/autoconfigure/GrpcClientProperties.java | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/module/spring-boot-grpc-client/src/main/java/org/springframework/boot/grpc/client/autoconfigure/GrpcClientProperties.java b/module/spring-boot-grpc-client/src/main/java/org/springframework/boot/grpc/client/autoconfigure/GrpcClientProperties.java index 71bccb055ba..a2638489cfa 100644 --- a/module/spring-boot-grpc-client/src/main/java/org/springframework/boot/grpc/client/autoconfigure/GrpcClientProperties.java +++ b/module/spring-boot-grpc-client/src/main/java/org/springframework/boot/grpc/client/autoconfigure/GrpcClientProperties.java @@ -25,8 +25,10 @@ import org.jspecify.annotations.Nullable; import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.bind.Name; +import org.springframework.boot.convert.DataSizeUnit; import org.springframework.boot.convert.DurationUnit; import org.springframework.util.unit.DataSize; +import org.springframework.util.unit.DataUnit; /** * Configuration properties for gRPC clients. @@ -167,9 +169,11 @@ public class GrpcClientProperties { public static class Message { /** - * Maximum message size allowed to be received by the channel. Set to '-1' - * to use the highest possible limit (not recommended). + * Maximum message size allowed to be received by the channel. If a data + * size suffix is not specified, bytes will be used. Set to '-1' to use + * the highest possible limit (not recommended). */ + @DataSizeUnit(DataUnit.BYTES) private DataSize maxSize = DataSize.ofBytes(4194304); public DataSize getMaxSize() { @@ -188,9 +192,11 @@ public class GrpcClientProperties { public static class Metadata { /** - * Maximum metadata size allowed to be received by the channel. Set to - * '-1' to use the highest possible limit (not recommended). + * Maximum metadata size allowed to be received by the channel. If a data + * size suffix is not specified, bytes will be used.Set to '-1' to use the + * highest possible limit (not recommended). */ + @DataSizeUnit(DataUnit.BYTES) private DataSize maxSize = DataSize.ofBytes(8192); public DataSize getMaxSize() {