Compressed POST payloads in RestExpress?

60 views
Skip to first unread message

Paul Vaillancourt

unread,
May 23, 2017, 12:12:22 PM5/23/17
to RestExpress
I am trying to send gzipped payloads to my RestExpress server POST routes to reduce the amount of data going over the wire. I see that RestExpress by default will gzip the response, but what about a request? Do i need to implement the decompression with a preprocessor?

Todd Fredrich

unread,
May 24, 2017, 11:42:45 AM5/24/17
to RestExpress
Hi Paul,

The Netty pipeline that gets setup by RestExpress does handle incoming gzipped requests as well as gzip responses. The pipeline is configured with a https://netty.io/4.0/api/io/netty/handler/codec/http/HttpContentDecompressor.html and should handle it correctly. It does, however, depend on the request headers to decode correctly.

Thanks,
--Todd

Paul Vaillancourt

unread,
May 25, 2017, 5:24:07 PM5/25/17
to RestExpress
Thanks for the response Todd. I got the gzipped payloads to work with curl, up to a point. We have the restExpress.max.payload.size set to 700k on the server, but any POST requests with binary data over  ~2.5k seem to have the request blocked, and is not even getting to the controller method.

The restExpress.max.payload.size applies to binary data, too, correct?

Thanks,
Paul

Ori S

unread,
May 28, 2017, 5:16:31 PM5/28/17
to RestExpress
Sounds like a proxy is sitting in front of RestExpress, could that be the case? If so, check that the proxy is also configured to allow the same data packet size.

/OS

Paul Vaillancourt

unread,
May 30, 2017, 12:06:39 PM5/30/17
to RestExpress
Ori,
Thanks, but i see this on my local machine, too. No proxy...

Todd Fredrich

unread,
Jul 24, 2017, 7:22:54 PM7/24/17
to RestExpress
Hi Paul,

It seems like there's something else going on as when the max payload size is exceeded, an error is returned--the request doesn't block. If this endpoint is being called repeatedly, perhaps the number of connections on the machine (ephemeral ports) are exhausted? Maybe try upping the ulimit. If the HTTP client is using 1.0 instead of 1.1 the connection keep-alive could be getting messed up. Or other weirdness like that. Sorry I can't help more without deeper information.

--Todd
Reply all
Reply to author
Forward
0 new messages