Class GrpcServerAutoConfiguration
java.lang.Object
net.devh.boot.grpc.server.autoconfigure.GrpcServerAutoConfiguration
@Configuration(proxyBeanMethods=false)
@EnableConfigurationProperties
@ConditionalOnClass(io.grpc.Server.class)
@AutoConfigureAfter(net.devh.boot.grpc.common.autoconfigure.GrpcCommonCodecAutoConfiguration.class)
public class GrpcServerAutoConfiguration
extends Object
The auto configuration used by Spring-Boot that contains all beans to run a grpc server/service.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic GrpcRequestScope
A scope that is valid for the duration of a grpc request.grpcServerLifecycle
(GrpcServerFactory factory, GrpcServerProperties properties, ApplicationEventPublisher eventPublisher) selfNameResolverFactory
(GrpcServerProperties properties) Lazily creates aSelfNameResolverFactory
bean, that can be used by the client to connect to the server itself.
-
Constructor Details
-
GrpcServerAutoConfiguration
public GrpcServerAutoConfiguration()
-
-
Method Details
-
grpcRequestScope
A scope that is valid for the duration of a grpc request.- Returns:
- The grpc request scope bean.
-
defaultGrpcServerProperties
-
selfNameResolverFactory
@ConditionalOnMissingBean @Bean @Lazy public SelfNameResolverFactory selfNameResolverFactory(GrpcServerProperties properties) Lazily creates aSelfNameResolverFactory
bean, that can be used by the client to connect to the server itself.- Parameters:
properties
- The properties to derive the address from.- Returns:
- The newly created
SelfNameResolverFactory
bean.
-
defaultGrpcServiceDiscoverer
-
compressionServerConfigurer
@ConditionalOnBean(io.grpc.CompressorRegistry.class) @Bean public GrpcServerConfigurer compressionServerConfigurer(CompressorRegistry registry) -
decompressionServerConfigurer
@ConditionalOnBean(io.grpc.DecompressorRegistry.class) @Bean public GrpcServerConfigurer decompressionServerConfigurer(DecompressorRegistry registry) -
defaultServerConfigurers
@ConditionalOnMissingBean(GrpcServerConfigurer.class) @Bean public List<GrpcServerConfigurer> defaultServerConfigurers() -
grpcServerLifecycle
@ConditionalOnMissingBean @ConditionalOnBean(GrpcServerFactory.class) @Bean public GrpcServerLifecycle grpcServerLifecycle(GrpcServerFactory factory, GrpcServerProperties properties, ApplicationEventPublisher eventPublisher)
-