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,
GlobalClientInterceptorRegistry globalClientInterceptorRegistry,
List<GrpcChannelConfigurer> channelConfigurers)
Creates a new GrpcChannelFactory for netty with the given options.
|
Modifier and Type | Method and Description |
---|---|
protected static void |
configureAcceptedServerCertificates(GrpcChannelProperties.Security security,
io.netty.handler.ssl.SslContextBuilder sslContextBuilder)
Configures the server certificates accepted by the ssl context.
|
protected static void |
configureProvidedClientCertificate(GrpcChannelProperties.Security security,
io.netty.handler.ssl.SslContextBuilder sslContextBuilder)
Configures the client certificate provided by the ssl context.
|
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, getConnectivityState, getPropertiesFor, isNonNullAndNonBlank, newManagedChannel, watchConnectivityState
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
createChannel
public NettyChannelFactory(GrpcChannelsProperties properties, GlobalClientInterceptorRegistry globalClientInterceptorRegistry, List<GrpcChannelConfigurer> channelConfigurers)
properties
- The properties for the channels to create.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 void configureProvidedClientCertificate(GrpcChannelProperties.Security security, io.netty.handler.ssl.SslContextBuilder sslContextBuilder)
security
- The security configuration to use.sslContextBuilder
- The ssl context builder to configure.protected static void configureAcceptedServerCertificates(GrpcChannelProperties.Security security, io.netty.handler.ssl.SslContextBuilder sslContextBuilder)
security
- The security configuration to use.sslContextBuilder
- The ssl context builder to configure.protected static NegotiationType of(NegotiationType negotiationType)
negotiationType
- The negotiation type to convert.