The problem:

I am getting this error while receiving message in grpc:

rpc error: code = ResourceExhausted desc = grpc: received message larger than max (8653851 vs. 4194304)

What I tried:

I gave the option to increase the size of the message to be received but it still gave the same error which means this setting of maximum size didn't work:

size := 1024 * 1024 * 12
opts = append(opts, grpc.WithDefaultCallOptions(grpc.MaxCallRecvMsgSize(size)))
conn, err := grpc.Dial(address, opts...)

Comments:

1024 * 1024 * 4 = 41943041024 * 1024 * 12 = 12582912