Skip to content

Commit 77b5f2f

Browse files
hwjiangkaiifplusor
authored andcommitted
feat: add grpc recv msg size (#635)
Signed-off-by: jyjiangkai <jyjiangkai@163.com>
1 parent 8cdd729 commit 77b5f2f

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

client/internal/net/connection/connect.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,18 @@ import (
2727
errinterceptor "github.com/vanus-labs/vanus/api/grpc/interceptor/errors"
2828
)
2929

30+
const (
31+
maxRecvMsgSize = 30 * 1024 * 1024
32+
)
33+
3034
func Connect(ctx context.Context, endpoint string) (*grpc.ClientConn, error) {
3135
opts := []grpc.DialOption{
3236
grpc.WithBlock(),
3337
grpc.WithTransportCredentials(insecure.NewCredentials()),
3438
grpc.WithUnaryInterceptor(otelgrpc.UnaryClientInterceptor()),
3539
grpc.WithStreamInterceptor(otelgrpc.StreamClientInterceptor()),
3640
grpc.WithUnaryInterceptor(errinterceptor.UnaryClientInterceptor()),
41+
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(maxRecvMsgSize)),
3742
}
3843
conn, err := grpc.DialContext(ctx, endpoint, opts...)
3944
if err != nil {

0 commit comments

Comments
 (0)