Interface GrpcChannelBuilderCustomizer<T extends io.grpc.ManagedChannelBuilder<T>>

Type Parameters:
T - type of builder
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface GrpcChannelBuilderCustomizer<T extends io.grpc.ManagedChannelBuilder<T>>
Callback interface that can be used to customize a ManagedChannelBuilder for a specific target.
Author:
Dave Syer, Chris Bono
  • Method Details

    • customize

      void customize(String target, T builder)
      Callback to customize a channel builder instance for a specific target string. The target can be either a valid nameresolver-compliant URI or an authority string as described in Grpc.newChannelBuilder(String, ChannelCredentials), or the name of a user-configured channel (e.g. 'my-channel').
      Parameters:
      target - the target string
      builder - the builder to customize
    • then

    • defaults

      static <T extends io.grpc.ManagedChannelBuilder<T>> GrpcChannelBuilderCustomizer<T> defaults()
      Used to indicate no customizations should be made to the builder.
      Type Parameters:
      T - type of channel builder
      Returns:
      the default customizer
    • matching

      static <T extends io.grpc.ManagedChannelBuilder<T>> GrpcChannelBuilderCustomizer<T> matching(String pattern, Consumer<io.grpc.ManagedChannelBuilder<T>> consumer)