public class NettyChannelFactory extends AbstractChannelFactory<io.grpc.netty.NettyChannelBuilder>
GrpcChannelFactory
s. This class
utilizes connection pooling and thus needs to be closed
after usage.channelConfigurers, globalClientInterceptorRegistry
Constructor and Description |
---|
NettyChannelFactory(GrpcChannelsProperties properties,
io.grpc.LoadBalancer.Factory loadBalancerFactory,
java.util.function.Function<T,io.grpc.NameResolver.Factory> nameResolverFactoryCreator,
GlobalClientInterceptorRegistry globalClientInterceptorRegistry,
java.util.List<GrpcChannelConfigurer> channelConfigurers)
Creates a new AbstractNettyChannelFactory with partially lazy initialized references.
|
NettyChannelFactory(GrpcChannelsProperties properties,
io.grpc.LoadBalancer.Factory loadBalancerFactory,
io.grpc.NameResolver.Factory nameResolverFactory,
GlobalClientInterceptorRegistry globalClientInterceptorRegistry,
java.util.List<GrpcChannelConfigurer> channelConfigurers)
Creates a new AbstractNettyChannelFactory with eager initialized references.
|
Modifier and Type | Method and Description |
---|---|
protected void |
configureSecurity(io.grpc.netty.NettyChannelBuilder builder,
java.lang.String name)
Configures the security options that should be used by the channel.
|
protected io.grpc.netty.NettyChannelBuilder |
newChannelBuilder(java.lang.String name)
Creates a new
ManagedChannelBuilder for the given client name. |
protected static io.grpc.netty.NegotiationType |
of(NegotiationType negotiationType)
Converts the given negotiation type to netty's negotiation type.
|
close, configure, configureCompression, configureKeepAlive, configureLimits, createChannel, createChannel, getPropertiesFor, isNonNullAndNonBlank, newManagedChannel, toCheckedFile
public NettyChannelFactory(GrpcChannelsProperties properties, io.grpc.LoadBalancer.Factory loadBalancerFactory, io.grpc.NameResolver.Factory nameResolverFactory, GlobalClientInterceptorRegistry globalClientInterceptorRegistry, java.util.List<GrpcChannelConfigurer> channelConfigurers)
properties
- The properties for the channels to create.loadBalancerFactory
- The load balancer factory to use.nameResolverFactory
- The name resolver factory to use.globalClientInterceptorRegistry
- The interceptor registry to use.channelConfigurers
- The channel configurers to use. Can be empty.public NettyChannelFactory(GrpcChannelsProperties properties, io.grpc.LoadBalancer.Factory loadBalancerFactory, java.util.function.Function<T,io.grpc.NameResolver.Factory> nameResolverFactoryCreator, GlobalClientInterceptorRegistry globalClientInterceptorRegistry, java.util.List<GrpcChannelConfigurer> channelConfigurers)
T
- The type of the actual factory class or one of its super classes.properties
- The properties for the channels to create.loadBalancerFactory
- The load balancer factory to use.nameResolverFactoryCreator
- The function that creates the name resolver factory.globalClientInterceptorRegistry
- The interceptor registry to use.channelConfigurers
- The channel configurers to use. Can be empty.protected io.grpc.netty.NettyChannelBuilder newChannelBuilder(java.lang.String name)
AbstractChannelFactory
ManagedChannelBuilder
for the given client name.newChannelBuilder
in class AbstractChannelFactory<io.grpc.netty.NettyChannelBuilder>
name
- The name to create the channel builder for.protected void configureSecurity(io.grpc.netty.NettyChannelBuilder builder, java.lang.String name)
AbstractChannelFactory
configureSecurity
in class AbstractChannelFactory<io.grpc.netty.NettyChannelBuilder>
builder
- The channel builder to configure.name
- The name of the client to configure.protected static io.grpc.netty.NegotiationType of(NegotiationType negotiationType)
negotiationType
- The negotiation type to convert.