public class NettyChannelFactory extends AbstractChannelFactory<NettyChannelBuilder>
GrpcChannelFactory
s. This class
utilizes connection pooling and thus needs to be closed
after usage.channelConfigurers, globalClientInterceptorRegistry
Constructor and Description |
---|
NettyChannelFactory(GrpcChannelsProperties properties,
LoadBalancer.Factory loadBalancerFactory,
Function<T,NameResolver.Factory> nameResolverFactoryCreator,
GlobalClientInterceptorRegistry globalClientInterceptorRegistry,
List<GrpcChannelConfigurer> channelConfigurers)
Creates a new AbstractNettyChannelFactory with partially lazy initialized references.
|
NettyChannelFactory(GrpcChannelsProperties properties,
LoadBalancer.Factory loadBalancerFactory,
NameResolver.Factory nameResolverFactory,
GlobalClientInterceptorRegistry globalClientInterceptorRegistry,
List<GrpcChannelConfigurer> channelConfigurers)
Creates a new AbstractNettyChannelFactory with eager initialized references.
|
Modifier and Type | Method and Description |
---|---|
protected void |
configureSecurity(NettyChannelBuilder builder,
String name)
Configures the security options that should be used by the channel.
|
protected NettyChannelBuilder |
newChannelBuilder(String name)
Creates a new
ManagedChannelBuilder for the given client name. |
protected static 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, LoadBalancer.Factory loadBalancerFactory, NameResolver.Factory nameResolverFactory, GlobalClientInterceptorRegistry globalClientInterceptorRegistry, 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, LoadBalancer.Factory loadBalancerFactory, Function<T,NameResolver.Factory> nameResolverFactoryCreator, GlobalClientInterceptorRegistry globalClientInterceptorRegistry, 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 NettyChannelBuilder newChannelBuilder(String name)
AbstractChannelFactory
ManagedChannelBuilder
for the given client name.newChannelBuilder
in class AbstractChannelFactory<NettyChannelBuilder>
name
- The name to create the channel builder for.protected void configureSecurity(NettyChannelBuilder builder, String name)
AbstractChannelFactory
configureSecurity
in class AbstractChannelFactory<NettyChannelBuilder>
builder
- The channel builder to configure.name
- The name of the client to configure.protected static NegotiationType of(NegotiationType negotiationType)
negotiationType
- The negotiation type to convert.