From 1397632f039d230e8890de2fcebe2efab1e98b28 Mon Sep 17 00:00:00 2001 From: Chris Bono Date: Mon, 28 Oct 2024 13:34:50 -0500 Subject: [PATCH] Polish "Allow GrpcServlet to be configured" * Re-order imports (we need to add the checkstyle rules to keep these consistent) * Remove implied comment in auto-configuration --- .../server/GrpcServerFactoryAutoConfiguration.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/GrpcServerFactoryAutoConfiguration.java b/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/GrpcServerFactoryAutoConfiguration.java index 4aae02a..0c5df78 100644 --- a/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/GrpcServerFactoryAutoConfiguration.java +++ b/spring-grpc-spring-boot-autoconfigure/src/main/java/org/springframework/grpc/autoconfigure/server/GrpcServerFactoryAutoConfiguration.java @@ -18,6 +18,10 @@ package org.springframework.grpc.autoconfigure.server; import java.util.List; import java.util.stream.Collectors; +import io.grpc.BindableService; +import io.grpc.servlet.jakarta.GrpcServlet; +import io.grpc.servlet.jakarta.ServletServerBuilder; + import org.springframework.boot.autoconfigure.AutoConfiguration; import org.springframework.boot.autoconfigure.AutoConfigureOrder; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -33,10 +37,6 @@ import org.springframework.context.annotation.Import; import org.springframework.core.Ordered; import org.springframework.util.unit.DataSize; -import io.grpc.BindableService; -import io.grpc.servlet.jakarta.GrpcServlet; -import io.grpc.servlet.jakarta.ServletServerBuilder; - /** * {@link EnableAutoConfiguration Auto-configuration} for gRPC server-side components. *

@@ -74,7 +74,6 @@ public class GrpcServerFactoryAutoConfiguration { ServletServerBuilder servletServerBuilder = new ServletServerBuilder(); services.forEach(servletServerBuilder::addService); PropertyMapper mapper = PropertyMapper.get().alwaysApplyingWhenNonNull(); - // Only maxInboundMessageSize is customizable mapper.from(properties.getMaxInboundMessageSize()) .asInt(DataSize::toBytes) .to(servletServerBuilder::maxInboundMessageSize);