From 2ae23499f3bef20f1de6b0a82ad20051ec20524f Mon Sep 17 00:00:00 2001 From: Clayton Walker Date: Thu, 8 Feb 2024 14:02:56 -0700 Subject: [PATCH 1/3] Upgrade grpc and remove unused method --- build.gradle | 2 +- .../channelfactory/AbstractChannelFactory.java | 14 -------------- 2 files changed, 1 insertion(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index 829834600..ba2d23d4c 100644 --- a/build.gradle +++ b/build.gradle @@ -11,7 +11,7 @@ buildscript { projectVersion = '3.0.0.RELEASE' // https://github.com/grpc/grpc-java/releases - grpcVersion = '1.60.1' + grpcVersion = '1.61.1' // https://github.com/google/guava/releases guavaVersion = '33.0.0-jre' diff --git a/grpc-client-spring-boot-starter/src/main/java/net/devh/boot/grpc/client/channelfactory/AbstractChannelFactory.java b/grpc-client-spring-boot-starter/src/main/java/net/devh/boot/grpc/client/channelfactory/AbstractChannelFactory.java index 7db3c6903..e16f79770 100644 --- a/grpc-client-spring-boot-starter/src/main/java/net/devh/boot/grpc/client/channelfactory/AbstractChannelFactory.java +++ b/grpc-client-spring-boot-starter/src/main/java/net/devh/boot/grpc/client/channelfactory/AbstractChannelFactory.java @@ -181,7 +181,6 @@ protected void configure(final T builder, final String name) { configureKeepAlive(builder, name); configureSecurity(builder, name); configureLimits(builder, name); - configureCompression(builder, name); configureUserAgent(builder, name); for (final GrpcChannelConfigurer channelConfigurer : this.channelConfigurers) { channelConfigurer.accept(builder, name); @@ -251,19 +250,6 @@ protected void configureLimits(final T builder, final String name) { } } - /** - * Configures the compression options that should be used by the channel. - * - * @param builder The channel builder to configure. - * @param name The name of the client to configure. - */ - protected void configureCompression(final T builder, final String name) { - final GrpcChannelProperties properties = getPropertiesFor(name); - if (properties.isFullStreamDecompression()) { - builder.enableFullStreamDecompression(); - } - } - /** * Configures custom User-Agent for the channel. * From 4f7512668b9377fe8cf1ba07687b8a7787fc6b0b Mon Sep 17 00:00:00 2001 From: Clayton Walker Date: Thu, 8 Feb 2024 14:04:40 -0700 Subject: [PATCH 2/3] Remove flag in properties --- .../client/config/GrpcChannelProperties.java | 32 ------------------- 1 file changed, 32 deletions(-) diff --git a/grpc-client-spring-boot-starter/src/main/java/net/devh/boot/grpc/client/config/GrpcChannelProperties.java b/grpc-client-spring-boot-starter/src/main/java/net/devh/boot/grpc/client/config/GrpcChannelProperties.java index dff796cc1..22994b5a5 100644 --- a/grpc-client-spring-boot-starter/src/main/java/net/devh/boot/grpc/client/config/GrpcChannelProperties.java +++ b/grpc-client-spring-boot-starter/src/main/java/net/devh/boot/grpc/client/config/GrpcChannelProperties.java @@ -372,35 +372,6 @@ public void setMaxInboundMetadataSize(DataSize maxInboundMetadataSize) { } // -------------------------------------------------- - private Boolean fullStreamDecompression; - private static final boolean DEFAULT_FULL_STREAM_DECOMPRESSION = false; - - /** - * Gets whether full-stream decompression of inbound streams should be enabled. - * - * @return True, if full-stream decompression of inbound streams should be enabled. False otherwise. - * - * @see #setFullStreamDecompression(Boolean) - */ - public boolean isFullStreamDecompression() { - return this.fullStreamDecompression == null ? DEFAULT_FULL_STREAM_DECOMPRESSION : this.fullStreamDecompression; - } - - /** - * Sets whether full-stream decompression of inbound streams should be enabled. This will cause the channel's - * outbound headers to advertise support for GZIP compressed streams, and gRPC servers which support the feature may - * respond with a GZIP compressed stream. - * - * @param fullStreamDecompression Whether full stream decompression should be enabled or null to use the fallback. - * - * @see ManagedChannelBuilder#enableFullStreamDecompression() - */ - public void setFullStreamDecompression(final Boolean fullStreamDecompression) { - this.fullStreamDecompression = fullStreamDecompression; - } - - // -------------------------------------------------- - private NegotiationType negotiationType; private static final NegotiationType DEFAULT_NEGOTIATION_TYPE = NegotiationType.TLS; @@ -530,9 +501,6 @@ public void copyDefaultsFrom(final GrpcChannelProperties config) { if (this.maxInboundMessageSize == null) { this.maxInboundMessageSize = config.maxInboundMessageSize; } - if (this.fullStreamDecompression == null) { - this.fullStreamDecompression = config.fullStreamDecompression; - } if (this.negotiationType == null) { this.negotiationType = config.negotiationType; } From a46299a8e1c5e40e02ae58e1515f540e36bb7323 Mon Sep 17 00:00:00 2001 From: Clayton Walker Date: Wed, 13 Mar 2024 19:13:51 -1000 Subject: [PATCH 3/3] Also remove option from spring configuration metadata --- .../META-INF/additional-spring-configuration-metadata.json | 7 ------- 1 file changed, 7 deletions(-) diff --git a/grpc-client-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json b/grpc-client-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json index c3f599700..44903c96e 100644 --- a/grpc-client-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json +++ b/grpc-client-spring-boot-starter/src/main/resources/META-INF/additional-spring-configuration-metadata.json @@ -53,13 +53,6 @@ "description": "Whether keepAlive should be enabled.", "defaultValue": false }, - { - "name": "grpc.client.GLOBAL.full-stream-decompression", - "type": "java.lang.Boolean", - "sourceType": "net.devh.boot.grpc.client.config.GrpcChannelProperties", - "description": "Whether full-stream decompression of inbound streams should be enabled.", - "defaultValue": false - }, { "name": "grpc.client.GLOBAL.keep-alive-time", "type": "java.time.Duration",