Skip to content

Commit

Permalink
rpc:gateway.go set rcp MaxGateWayRecvMsgSize
Browse files Browse the repository at this point in the history
  • Loading branch information
fengzi committed Jun 14, 2018
1 parent f916252 commit 5bce7f1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion rpc/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const (
const (
// DefaultHTTPLimit default max http conns
DefaultHTTPLimit = 128
// MaxRecvMsgSize Deafult max message size gateway's grpc client can receive
MaxGateWayRecvMsgSize = 64 * 1024 * 1024
)

// Run start gateway proxy to mapping grpc to http.
Expand All @@ -37,7 +39,9 @@ func Run(config *nebletpb.RPCConfig) error {
mux := runtime.NewServeMux(runtime.WithMarshalerOption(runtime.MIMEWildcard,
&runtime.JSONPb{OrigName: true, EmitDefaults: true}),
runtime.WithProtoErrorHandler(errorHandler))
opts := []grpc.DialOption{grpc.WithInsecure()}
opts := []grpc.DialOption{grpc.WithInsecure(),
grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(MaxGateWayRecvMsgSize))}

echoEndpoint := flag.String("rpc", config.RpcListen[0], "")
for _, v := range config.HttpModule {
switch v {
Expand Down

0 comments on commit 5bce7f1

Please sign in to comment.