Class InstantiatingGrpcChannelProvider.Builder (2.68.2) 
  
  
  
   
  
    
  
  
    
    
    
    
  Version 2.68.2keyboard_arrow_down  
  
 
    
    
    
    
      
  
  
  
    
public   static   final   class  InstantiatingGrpcChannelProvider . Builder  
  
  
  Methods
   
  build() 
  
    
public   InstantiatingGrpcChannelProvider   build ()  
  
  getChannelConfigurator() 
  
    
public   ApiFunction<ManagedChannelBuilder , ManagedChannelBuilder >  getChannelConfigurator ()  
  
    
      
        Returns  
      
        Type Description  
      
        ApiFunction <io.grpc.ManagedChannelBuilder ,io.grpc.ManagedChannelBuilder > 
     
  
  getEndpoint() 
  
    
public   String   getEndpoint ()  
  
    
      
        Returns  
      
        Type Description  
      
        String  
     
  
  getKeepAliveTime() 
  
    
public   Duration   getKeepAliveTime ()  
  
Obsolete 
Use getKeepAliveTimeDuration() instead 
This feature is stable for usage in this major version, but may be deprecated in a future release.
 
This method is obsolete. Use #getKeepAliveTimeDuration()  instead.
    
      
        Returns  
      
        Type Description  
      
        org.threeten.bp.Duration  
     
  
  getKeepAliveTimeDuration() 
  
    
public   Duration   getKeepAliveTimeDuration ()  
  The time without read activity before sending a keepalive ping.
getKeepAliveTimeout() 
  
    
public   Duration   getKeepAliveTimeout ()  
  
Obsolete 
Use getKeepAliveTimeoutDuration() instead 
This feature is stable for usage in this major version, but may be deprecated in a future release.
 
This method is obsolete. Use #getKeepAliveTimeoutDuration()  instead
    
      
        Returns  
      
        Type Description  
      
        org.threeten.bp.Duration  
     
  
  getKeepAliveTimeoutDuration() 
  
    
public   Duration   getKeepAliveTimeoutDuration ()  
  The time without read activity after sending a keepalive ping.
getKeepAliveWithoutCalls() 
  
    
public   Boolean   getKeepAliveWithoutCalls ()  
  Whether keepalive will be performed when there are no outstanding RPCs.
getMaxInboundMessageSize() 
  
    
public   Integer   getMaxInboundMessageSize ()  
  The maximum message size allowed to be received on the channel.
    
public   Integer   getMaxInboundMetadataSize ()  
  
Beta 
The surface for maximum metadata size is not stable yet and may change in the future. 
This feature is covered by the Pre-GA Offerings Terms  of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.
 
The maximum metadata size allowed to be received on the channel.
getPoolSize() (deprecated) 
  
  
  
    
      
        Returns  
      
        Type Description  
      
        int  
     
  
  setAllowHardBoundTokenTypes(List<InstantiatingGrpcChannelProvider.HardBoundTokenTypes> allowedValues) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setAllowHardBoundTokenTypes ( List<InstantiatingGrpcChannelProvider . HardBoundTokenTypes >  allowedValues )  
  
  
  
  setAllowNonDefaultServiceAccount(boolean allowNonDefaultServiceAccount) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setAllowNonDefaultServiceAccount ( boolean   allowNonDefaultServiceAccount )  
  
Internal Only : This feature is not stable for application use.
For internal use by google-cloud-java clients only 
 
Whether allow non-default service account for DirectPath.
    
      
        Parameter  
      
        Name Description  
      
        allowNonDefaultServiceAccountboolean  
     
  
  
  setAttemptDirectPath(boolean attemptDirectPath) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setAttemptDirectPath ( boolean   attemptDirectPath )  
  
Internal Only : This feature is not stable for application use.
For internal use by google-cloud-java clients only 
 
Whether attempt DirectPath.
    
      
        Parameter  
      
        Name Description  
      
        attemptDirectPathboolean  
     
  
  
  setAttemptDirectPathXds() 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setAttemptDirectPathXds ()  
  
Internal Only : This feature is not stable for application use.
For internal use by google-cloud-java clients only 
 
Use DirectPath xDS. Only valid if DirectPath is attempted.
setChannelConfigurator(ApiFunction<ManagedChannelBuilder,ManagedChannelBuilder> channelConfigurator) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setChannelConfigurator ( ApiFunction<ManagedChannelBuilder , ManagedChannelBuilder >  channelConfigurator )  
  
Beta 
Surface for advanced channel configuration is not yet stable 
This feature is covered by the Pre-GA Offerings Terms  of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.
 
Add a callback that can intercept channel creation.
 
This can be used for advanced configuration like setting the netty event loop. The
 callback will be invoked with a fully configured channel builder, which the callback can
 augment or replace.
    
      
        Parameter  
      
        Name Description  
      
        channelConfiguratorApiFunction <io.grpc.ManagedChannelBuilder ,io.grpc.ManagedChannelBuilder > 
     
  
  
  setChannelPoolSettings(ChannelPoolSettings settings) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setChannelPoolSettings ( ChannelPoolSettings   settings )  
  
Beta 
Channel pool sizing api is not yet stable 
This feature is covered by the Pre-GA Offerings Terms  of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.
 
setChannelPrimer(ChannelPrimer channelPrimer) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setChannelPrimer ( ChannelPrimer   channelPrimer )  
  
Internal Only : This feature is not stable for application use.
For internal use by google-cloud-java clients only 
 
By setting a channelPrimer, the ChannelPool created by the provider will be refreshing
 ChannelPool. channelPrimer will be invoked periodically when the channels are refreshed
 
This is public only for technical reasons, for advanced usage.
    
      
        Parameter  
      
        Name Description  
      
        channelPrimerChannelPrimer invoked when the channels are refreshed
 
     
  
  
  setChannelsPerCpu(double multiplier) (deprecated) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setChannelsPerCpu ( double   multiplier )  
  
  
    
      
        Parameter  
      
        Name Description  
      
        multiplierdouble  
     
  
  
  setChannelsPerCpu(double multiplier, int maxChannels) (deprecated) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setChannelsPerCpu ( double   multiplier ,   int   maxChannels )  
  
  
    
      
        Parameters  
      
        Name Description  
      
        multiplierdouble  
      
        maxChannelsint  
     
  
  
  setCredentials(Credentials credentials) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setCredentials ( Credentials   credentials )  
  
    
      
        Parameter  
      
        Name Description  
      
        credentialscom.google.auth.Credentials  
     
  
  
  setDirectPathServiceConfig(Map<String,?> serviceConfig) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setDirectPathServiceConfig ( Map<String , ? >  serviceConfig )  
  
Internal Only : This feature is not stable for application use.
For internal use by google-cloud-java clients only 
 
Sets a service config for direct path. If direct path is not enabled, the provided service
 config will be ignored.
 
See 
 the service config proto definition  for more details.
    
      
        Parameter  
      
        Name Description  
      
        serviceConfigMap <String ,? > 
     
  
  
  setEndpoint(String endpoint) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setEndpoint ( String   endpoint )  
  Sets the endpoint used to reach the service, eg "localhost:8080".
    
      
        Parameter  
      
        Name Description  
      
        endpointString  
     
  
  
  setExecutor(Executor executor) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setExecutor ( Executor   executor )  
  Sets the Executor for this TransportChannelProvider.
 
This is optional; if it is not provided, needsExecutor() will return true, meaning that an
 Executor must be provided when getChannel is called on the constructed
 TransportChannelProvider instance. Note: GrpcTransportProvider will automatically provide its
 own Executor in this circumstance when it calls getChannel.
    
      
        Parameter  
      
        Name Description  
      
        executorExecutor  
     
  
  
  setExecutorProvider(ExecutorProvider executorProvider) (deprecated) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setExecutorProvider ( ExecutorProvider   executorProvider )  
  
  
  
  
  
  
    
public   InstantiatingGrpcChannelProvider . Builder   setHeaderProvider ( HeaderProvider   headerProvider )  
  Sets the HeaderProvider for this TransportChannelProvider.
 
This is optional; if it is not provided, needsHeaders() will return true, meaning that
 headers must be provided when getChannel is called on the constructed
 TransportChannelProvider instance.
setInterceptorProvider(GrpcInterceptorProvider interceptorProvider) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setInterceptorProvider ( GrpcInterceptorProvider   interceptorProvider )  
  Sets the GrpcInterceptorProvider for this TransportChannelProvider.
 
The provider will be called once for each underlying gRPC ManagedChannel that is created.
 It is recommended to return a new list of new interceptors on each call so that interceptors
 are not shared among channels, but this is not required.
setKeepAliveTime(Duration duration) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setKeepAliveTime ( Duration   duration )  
  
Obsolete 
Use setKeepAliveTimeDuration(java.time.Duration) instead 
This feature is stable for usage in this major version, but may be deprecated in a future release.
 
This method is obsolete. Use #setKeepAliveTimeDuration(java.time.Duration)  instead.
    
      
        Parameter  
      
        Name Description  
      
        durationorg.threeten.bp.Duration  
     
  
  
  setKeepAliveTimeDuration(Duration duration) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setKeepAliveTimeDuration ( Duration   duration )  
  The time without read activity before sending a keepalive ping.
    
      
        Parameter  
      
        Name Description  
      
        durationDuration  
     
  
  
  setKeepAliveTimeout(Duration duration) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setKeepAliveTimeout ( Duration   duration )  
  
Obsolete 
Use setKeepAliveTimeoutDuration(java.time.Duration) instead 
This feature is stable for usage in this major version, but may be deprecated in a future release.
 
This method is obsolete. Use #setKeepAliveTimeoutDuration(java.time.Duration) 
 instead.
    
      
        Parameter  
      
        Name Description  
      
        durationorg.threeten.bp.Duration  
     
  
  
  setKeepAliveTimeoutDuration(Duration duration) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setKeepAliveTimeoutDuration ( Duration   duration )  
  The time without read activity after sending a keepalive ping.
    
      
        Parameter  
      
        Name Description  
      
        durationDuration  
     
  
  
  setKeepAliveWithoutCalls(Boolean keepalive) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setKeepAliveWithoutCalls ( Boolean   keepalive )  
  Whether keepalive will be performed when there are no outstanding RPCs.
    
      
        Parameter  
      
        Name Description  
      
        keepaliveBoolean  
     
  
  
  setMaxInboundMessageSize(Integer max) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setMaxInboundMessageSize ( Integer   max )  
  The maximum message size allowed to be received on the channel.
    
      
        Parameter  
      
        Name Description  
      
        maxInteger  
     
  
  
  
    
public   InstantiatingGrpcChannelProvider . Builder   setMaxInboundMetadataSize ( Integer   max )  
  
Beta 
The surface for maximum metadata size is not stable yet and may change in the future. 
This feature is covered by the Pre-GA Offerings Terms  of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see the launch stage descriptions.
 
The maximum metadata size allowed to be received on the channel.
    
      
        Parameter  
      
        Name Description  
      
        maxInteger  
     
  
  
  setMtlsEndpoint(String mtlsEndpoint) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setMtlsEndpoint ( String   mtlsEndpoint )  
  
Internal Only : This feature is not stable for application use.
This public method is used by Gax to help configure the MTLS endpoint for S2A 
 
Sets the mTLS Endpoint used to reach the service, eg "localhost:8080".
    
      
        Parameter  
      
        Name Description  
      
        mtlsEndpointString  
     
  
  
  setPoolSize(int poolSize) (deprecated) 
  
    
public   InstantiatingGrpcChannelProvider . Builder   setPoolSize ( int   poolSize )  
  
  
    
      
        Parameter  
      
        Name Description  
      
        poolSizeint  
     
  
  
 
     
    
  
  
  
     
  
    
    
      
       
    
    
  
  
 
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License , and code samples are licensed under the Apache 2.0 License . For details, see the Google Developers Site Policies . Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-10-29 UTC.
 
 
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-29 UTC."],[],[]]