Skip to content

Conversation

@Hakky54
Copy link
Contributor

@Hakky54 Hakky54 commented Apr 17, 2020

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: true Compression 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:

RequestOptions.Builder requestOptions = RequestOptions.DEFAULT.toBuilder()
    .addHeader("Accept-Encoding", "gzip")

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.

@Hakky54 Hakky54 changed the title Feature enable decompression of response within llrc Enable decompression of response within Low Level Rest Client Apr 17, 2020
@Hakky54 Hakky54 changed the title Enable decompression of response within Low Level Rest Client Enable decompression of response within LowLevelRestClient Apr 17, 2020
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-features (:Core/Features/Java High Level REST Client)

@elasticmachine elasticmachine added the Team:Data Management Meta label for data/management team label Apr 30, 2020
@andreidan andreidan self-requested a review April 30, 2020 14:02
@Hakky54
Copy link
Contributor Author

Hakky54 commented May 12, 2020

@andreidan have you had a chance to look at this, anything you want done differently?

Copy link
Contributor

@andreidan andreidan left a 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

Copy link
Contributor

@andreidan andreidan left a 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

@andreidan
Copy link
Contributor

ok to test

@andreidan andreidan merged commit 2621452 into elastic:master May 15, 2020
@Hakky54
Copy link
Contributor Author

Hakky54 commented May 15, 2020

Awesome! Thank you @andreidan!

@Hakky54 Hakky54 deleted the feature-enable-decompression-of-response-within-llrc branch May 15, 2020 13:30
andreidan pushed a commit to andreidan/elasticsearch that referenced this pull request May 15, 2020
…5413)

 Added support for decompression at LLRC and added integration test

(cherry picked from commit 2621452)
Signed-off-by: Andrei Dan <[email protected]>
andreidan added a commit that referenced this pull request May 15, 2020
…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]>
@jakelandis jakelandis removed the v8.0.0 label Jul 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants