-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Support request compression #93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The error message is actually wrong, Netty 3 doesn't properly handle BAD_REQUEST status code: netty/netty#441 @cstamas I know this is an old issue, but would you have a simple test case (server side) so I can investigate, please? |
I have a Gatling user who kindly provided a test case: https://docs.google.com/file/d/0B1zTVlhQrNiyZ01CZDFDWm5QYlk/edit Installation instructions:
Send POST requests to localhost:3000/post/test, XML bodies, compressed on not, will be printed in the console. RequestBuilder requestBuilder = new RequestBuilder("POST");
requestBuilder.setUrl("http://localhost:3001/post/test");
requestBuilder.setBody("<foo>bar</foo>".getBytes());
Request request = requestBuilder.build();
AsyncHttpClientConfig config = new AsyncHttpClientConfig.Builder().setRequestCompressionLevel(6).build();
AsyncHttpClient client = new AsyncHttpClient(config);
// AsyncHttpClient client = new AsyncHttpClient(); // works perfectly when no request compression
try {
client.executeRequest(request).get();
} finally {
client.close();
} Note that |
NettyAsyncHttpProvider wrongly uses a Actually, Netty doesn't support request compression yet. See netty/netty#2131 and netty/netty#2132 |
@jfarcand As this is a Netty feature request, I don't know when it will be implemented and I doubt it will be backported on Netty 3. I say that we remove the feature for now, both in AHC1 and AHC2. This won't cause regression is AHC1 because no user could possibly use it: it just makes the request break. |
Change title |
Agree. Closing as won't fix. |
@jfarcand I disagree. I've been asked for this feature on Gatling and had to implement it on my own, and it's not great and I'd rather have it supported in Netty. Let's just turn what first was an issue into a feature request (I did one on Netty). |
No activity there for a very long time. Closing for now. |
@slandelle I know you'd prefer to see this implemented in Netty, but what do you think about adding this to AHC until Netty finally supports request compression? I think it'd be doable using just a If you think it's worth considering, I can open a PR. Let me know. |
I don't think that would work with every kinds of response bodies. |
The following snippet fails to execute with AHC 1.7.3 and 1.7.4 (using default Netty provider):
If I comment out the line
configBuilder.setRequestCompressionLevel( 6 );
all is fine and snippet above works.Also, I'd like to have some explanation what this method is meant to do. By reading sources, it is used to set "compression level" on Netty's HttpContentEncoder (wanted to raise it from default 6 to 9). How are
setRequestCompressionLevel()
andsetCompressionEnabled()
corelated?Exception thrown by snippet above is:
The text was updated successfully, but these errors were encountered: