From 3b1d3e48c925e24950daaf3401a584b5224daca1 Mon Sep 17 00:00:00 2001 From: Doug Fawley Date: Tue, 19 Oct 2021 16:47:48 -0700 Subject: [PATCH] examples: update load balancing example to use loadBalancingConfig (#4887) --- examples/features/load_balancing/client/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/features/load_balancing/client/main.go b/examples/features/load_balancing/client/main.go index 1578df16671..72c5ad9c146 100644 --- a/examples/features/load_balancing/client/main.go +++ b/examples/features/load_balancing/client/main.go @@ -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(), @@ -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(), )