Skip to content

Enable support for compressed response within RestHighLevelClient #63087

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

Merged
merged 2 commits into from
Sep 30, 2020

Conversation

swallez
Copy link
Member

@swallez swallez commented Sep 30, 2020

Backport of #53533

This pull request is to enable the RestHighLevelClient to handle an Elasticsearch response which has compressed content. It was already possible to do this with the low level client, 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.

Hakky54 and others added 2 commits September 30, 2020 17:11
…ghLevelClient (elastic#53533)

Added decompression of gzip when gzip value is return as an header from Elasticsearch
@swallez swallez self-assigned this Sep 30, 2020
@swallez swallez merged commit e4e4aab into elastic:6.8 Sep 30, 2020
@swallez swallez deleted the 6.8-backport-53533 branch September 30, 2020 20:36
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.

None yet

2 participants