-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Enable decompression of response within LowLevelRestClient #55413
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
Enable decompression of response within LowLevelRestClient #55413
Conversation
|
Pinging @elastic/es-core-features (:Core/Features/Java High Level REST Client) |
|
@andreidan have you had a chance to look at this, anything you want done differently? |
andreidan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this @Hakky54. I've left a couple of minor suggestions/questions
qa/smoke-test-http/src/test/java/org/elasticsearch/http/HttpCompressionIT.java
Outdated
Show resolved
Hide resolved
client/rest-high-level/src/test/java/org/elasticsearch/client/RestHighLevelClientTests.java
Show resolved
Hide resolved
andreidan
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for working on this @Hakky54
|
ok to test |
|
Awesome! Thank you @andreidan! |
…5413) Added support for decompression at LLRC and added integration test (cherry picked from commit 2621452) Signed-off-by: Andrei Dan <[email protected]>
…56820) Added support for decompression at LLRC and added integration test (cherry picked from commit 2621452) Signed-off-by: Andrei Dan <[email protected]> Co-authored-by: Hakky54 <[email protected]>
This pull request is to enable the RestHighLevelClient and LowLevelRestClient to automatically handle an Elasticsearch response which has compressed content. It was already possible to do this with the low level client manually, see here AsyncElasticsearchCompressedRequest. Compression can enabled within a node configuration with the following property:
http.compression: trueCompression can be triggered by a request from a client. Therefor you also need to provide additional information within the header of the request to Elasticsearch if a client really wants to enable it. That is possible with the following RequestOptions:With these two properties Elasticsearch will return a gzip compressed response body. The RestHighLevelClient can send a request with the above request options but it couldn't handle the response yet. This feature request contains the option to handle a compressed response if it is compressed with gzip.
Initial changes for the RestHighLevelClient have been made within this pull request: #53533
Original feature requests: #53555 and #24349
This pull request is an improvement on the initial pull request. The LowLevelRestClient will get the responsibility to handle a compressed response and therefor this feature will also be supported within the RestHighLevelClient.