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
This commit is contained in:
@@ -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.
|
||||
* <p>
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user