Skip to content

Commit

Permalink
examples: update load balancing example to use loadBalancingConfig (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
dfawley committed Oct 19, 2021
1 parent 01ed648 commit 3b1d3e4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/features/load_balancing/client/main.go
Expand Up @@ -55,7 +55,7 @@ func makeRPCs(cc *grpc.ClientConn, n int) {
}

func main() {
// "pick_first" is the default, so there's no need to set the load balancer.
// "pick_first" is the default, so there's no need to set the load balancing policy.
pickfirstConn, err := grpc.Dial(
fmt.Sprintf("%s:///%s", exampleScheme, exampleServiceName),
grpc.WithInsecure(),
Expand All @@ -74,7 +74,7 @@ func main() {
// Make another ClientConn with round_robin policy.
roundrobinConn, err := grpc.Dial(
fmt.Sprintf("%s:///%s", exampleScheme, exampleServiceName),
grpc.WithDefaultServiceConfig(`{"loadBalancingPolicy":"round_robin"}`), // This sets the initial balancing policy.
grpc.WithDefaultServiceConfig(`{"loadBalancingConfig": [{"round_robin":{}}]}`), // This sets the initial balancing policy.
grpc.WithInsecure(),
grpc.WithBlock(),
)
Expand Down

0 comments on commit 3b1d3e4

Please sign in to comment.