[grpc-java] Limit message size for uncompressed grpc requests

137 views
Skip to first unread message

lpt...@gmail.com

unread,
Sep 28, 2016, 6:27:22 AM9/28/16
to grpc.io
I am looking for a way to enforce a limit on the size of the incoming requests (uncompressed). I have tried setting maxMessageSize on NettyServerBuilder, but it did not seem to work. After some debugging and searching, I found that this limit is only enforced in MessageDeframer, and only for compressed stream (from this commit: https://github.com/grpc/grpc-java/commit/15f02ba19c4a2c21afee39cb73cd0340ad2f9d1d). Does anyone know a way to set this for uncompressed requests?

Eric Anderson

unread,
Oct 1, 2016, 4:11:47 PM10/1/16
to lpt...@gmail.com, grpc.io
maxMessageSize applies to both uncompressed and compressed sizes. This is the check that applies to the on-the-wire size, independent of whether the message is compressed.

It seems you are aware it only applies to incoming messages, so I'm not sure why you wouldn't be experiencing it working.

What version of grpc-java are you using?

On Wed, Sep 28, 2016 at 3:27 AM, <lpt...@gmail.com> wrote:
I am looking for a way to enforce a limit on the size of the incoming requests (uncompressed). I have tried setting maxMessageSize on NettyServerBuilder, but it did not seem to work. After some debugging and searching, I found that this limit is only enforced in MessageDeframer, and only for compressed stream (from this commit: https://github.com/grpc/grpc-java/commit/15f02ba19c4a2c21afee39cb73cd0340ad2f9d1d). Does anyone know a way to set this for uncompressed requests?

--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/7d6dc331-44dc-4cd5-b16f-1a7bdd42fd7a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages