Skip to content

Commit

Permalink
enable round robin option in grpc client
Browse files Browse the repository at this point in the history
Currently grpc configuration doesn't provide options to change
load balancing. This PR adds default_service_config in proto
so users can customize grpc connections.
  • Loading branch information
lijunsong authored and EdSchouten committed Jan 23, 2025
1 parent 1c93796 commit 7ebb551
Show file tree
Hide file tree
Showing 3 changed files with 238 additions and 213 deletions.
7 changes: 7 additions & 0 deletions pkg/grpc/base_client_factory.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,13 @@ func (cf baseClientFactory) NewClientFromConfiguration(config *configuration.Cli
NewMetadataExtractingAndForwardingStreamClientInterceptor(extractor))
}

// Optional: service config.
if serviceConfig := config.DefaultServiceConfig; serviceConfig != "" {
dialOptions = append(
dialOptions,
grpc.WithDefaultServiceConfig(serviceConfig))
}

dialOptions = append(
dialOptions,
grpc.WithChainUnaryInterceptor(unaryInterceptors...),
Expand Down
Loading

0 comments on commit 7ebb551

Please sign in to comment.