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
  • 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 channels
      interceptorsConfigurer - 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: DefaultGrpcChannelFactory
      Creates a new ManagedChannelBuilder instance for the given target and credentials. The target is a valid nameresolver-compliant URI or an authority string as described in Grpc.newChannelBuilder(String, ChannelCredentials).
      Overrides:
      newChannelBuilder in class DefaultGrpcChannelFactory<io.grpc.netty.NettyChannelBuilder>
      Parameters:
      target - the target of the channel
      credentials - the credentials for the channel
      Returns:
      a new builder for the given target and credentials