Skip to content

Commit

Permalink
feat: add grpc recv msg size (#635)
Browse files Browse the repository at this point in the history
Signed-off-by: jyjiangkai <[email protected]>
  • Loading branch information
hwjiangkai authored and ifplusor committed Oct 10, 2023
1 parent 8cdd729 commit 77b5f2f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions client/internal/net/connection/connect.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,18 @@ import (
errinterceptor "github.com/vanus-labs/vanus/api/grpc/interceptor/errors"
)

const (
maxRecvMsgSize = 30 * 1024 * 1024
)

func Connect(ctx context.Context, endpoint string) (*grpc.ClientConn, error) {
opts := []grpc.DialOption{
grpc.WithBlock(),
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor()),
grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor()),
grpc.WithUnaryInterceptor(errinterceptor.UnaryClientInterceptor()),
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxRecvMsgSize)),
}
conn, err := grpc.DialContext(ctx, endpoint, opts...)
if err != nil {
Expand Down

0 comments on commit 77b5f2f

Please sign in to comment.