Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

address WithBalancerName deleted in grpc v1.46.0 #324

Merged
merged 2 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions mainboilerplate/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,15 @@ package mainboilerplate

import (
"context"
"fmt"
"time"

grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus"
"go.gazette.dev/core/broker/client"
pb "go.gazette.dev/core/broker/protocol"
pc "go.gazette.dev/core/consumer/protocol"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

// AddressConfig of a remote service.
Expand All @@ -20,8 +22,8 @@ type AddressConfig struct {
func (c *AddressConfig) MustDial(ctx context.Context) *grpc.ClientConn {
var cc, err = grpc.DialContext(ctx,
c.Address.GRPCAddr(),
grpc.WithInsecure(),
grpc.WithBalancerName(pb.DispatcherGRPCBalancerName),
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"loadBalancingConfig": [{"%s":{}}]}`, pb.DispatcherGRPCBalancerName)),
// Use a tighter bound for the maximum back-off delay (default is 120s).
// TODO(johnny): Make this configurable?
grpc.WithBackoffMaxDelay(time.Second*5),
Expand Down
5 changes: 3 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import (
pb "go.gazette.dev/core/broker/protocol"
"go.gazette.dev/core/task"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
)

// Server bundles gRPC & HTTP servers, multiplexed over a single bound TCP
Expand Down Expand Up @@ -91,8 +92,8 @@ func New(iface string, port string) (*Server, error) {
srv.GRPCLoopback, err = grpc.DialContext(
context.Background(),
srv.RawListener.Addr().String(),
grpc.WithInsecure(),
grpc.WithBalancerName(pb.DispatcherGRPCBalancerName),
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"loadBalancingConfig": [{"%s":{}}]}`, pb.DispatcherGRPCBalancerName)),
// This grpc.ClientConn connects to this server's loopback, and also
// to peer server addresses via the dispatch balancer. It has particular
// knowledge of what addresses *should* be reach-able (from Etcd
Expand Down