Class NettyGrpcChannelFactory
java.lang.Object
org.springframework.grpc.client.DefaultGrpcChannelFactory<io.grpc.netty.NettyChannelBuilder>
org.springframework.grpc.client.NettyGrpcChannelFactory
- All Implemented Interfaces:
org.springframework.beans.factory.DisposableBean, GrpcChannelFactory
public class NettyGrpcChannelFactory
extends DefaultGrpcChannelFactory<io.grpc.netty.NettyChannelBuilder>
GrpcChannelFactory that creates Netty-based gRPC channels.- Author:
- Chris Bono, Andrey Litvitski
-
Field Summary
Fields inherited from class DefaultGrpcChannelFactory
targets -
Constructor Summary
ConstructorsConstructorDescriptionNettyGrpcChannelFactory(List<GrpcChannelBuilderCustomizer<io.grpc.netty.NettyChannelBuilder>> globalCustomizers, ClientInterceptorsConfigurer interceptorsConfigurer) Construct a channel factory instance. -
Method Summary
Modifier and TypeMethodDescriptionprotected io.grpc.netty.NettyChannelBuildernewChannelBuilder(String target, io.grpc.ChannelCredentials credentials) Creates a newManagedChannelBuilderinstance for the given target and credentials.Methods inherited from class DefaultGrpcChannelFactory
createChannel, destroy, setCredentialsProvider, setInterceptorFilter, setVirtualTargets, supports, supportsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface GrpcChannelFactory
createChannel
-
Constructor Details
-
NettyGrpcChannelFactory
public NettyGrpcChannelFactory(List<GrpcChannelBuilderCustomizer<io.grpc.netty.NettyChannelBuilder>> globalCustomizers, ClientInterceptorsConfigurer interceptorsConfigurer) Construct a channel factory instance.- Parameters:
globalCustomizers- the global customizers to apply to all created channelsinterceptorsConfigurer- configures the client interceptors on the created channels
-
-
Method Details
-
newChannelBuilder
protected io.grpc.netty.NettyChannelBuilder newChannelBuilder(String target, io.grpc.ChannelCredentials credentials) Description copied from class:DefaultGrpcChannelFactoryCreates a newManagedChannelBuilderinstance for the given target and credentials. Thetargetis a valid nameresolver-compliant URI or an authority string as described inGrpc.newChannelBuilder(String, ChannelCredentials).- Overrides:
newChannelBuilderin classDefaultGrpcChannelFactory<io.grpc.netty.NettyChannelBuilder>- Parameters:
target- the target of the channelcredentials- the credentials for the channel- Returns:
- a new builder for the given target and credentials
-