Skip to content
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

Add support for gzip compression of query response #50

Closed
bednar opened this issue Aug 19, 2019 · 5 comments · Fixed by #51
Closed

Add support for gzip compression of query response #50

bednar opened this issue Aug 19, 2019 · 5 comments · Fixed by #51
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@bednar
Copy link
Contributor

bednar commented Aug 19, 2019

The clients should support compress queries after enable gzip: influxDBClient.enableGzip();

influxdata/influxdb#14495

@bednar bednar added the enhancement New feature or request label Aug 19, 2019
@bednar bednar added this to the 1.0.0.M3 milestone Aug 19, 2019
@bednar bednar self-assigned this Aug 19, 2019
@bednar bednar changed the title Add support to gzip compress the queries Add support for gzip compression of query response Aug 19, 2019
@antoinedvd
Copy link
Contributor

antoinedvd commented Mar 11, 2021

👋 Hi folks, I not quite sure that really works from a query executed by kotlin-client.
Indeed, the facts that we set application/json by default for all query() calls that blocks the BridgeInterceptor to do his job to add the Accept-Encoding: gzip header (quick look here 👀).
IMO the Accept-Encoding: application/json is not used by the InfluxDB server because it always sent you back application/csv data (for and InfluxDB 2.0 server with Flux request).

👉 So I have a commit ready to PR if you want, to fix this issue.

💬 Let me know what do you think, and if you want me to create it.

@bednar
Copy link
Contributor Author

bednar commented Mar 12, 2021

Hi @antoinedvd,

thanks for your comment. The default value for Accept-Encoding should be identity. The GZIP compression is managed by GzipInterceptor.java.

You could enable GZIP compression by:

var influxDBClient = influxDBClient.enableGzip()

https://github.com/influxdata/influxdb-client-java/blob/master/client-kotlin/src/main/kotlin/com/influxdb/client/kotlin/InfluxDBClientKotlin.kt#L71

Could you prepare a PR with Accept-Encoding: identity?

Regards

@antoinedvd
Copy link
Contributor

antoinedvd commented Mar 12, 2021

Hi @bednar,

Thank you for your answerd.

Of course I tried to use the var influxDBClient = influxDBClient.enableGzip() but that didn't works well.
If you look here :

// The okhttp3.internal.http.BridgeInterceptor add gzip accept
Its clearly wrote that gzip header is added by Bridge interceptor.
So if I add Accept-Encoding: identity the same issue will be produced. Don't you think ?

@bednar
Copy link
Contributor Author

bednar commented Mar 12, 2021

So if I add Accept-Encoding: identity the same issue will be produced. Don't you think ?

You are right, sorry for wrong direction ... feel free to create PR

@antoinedvd
Copy link
Contributor

@bednar no pb 😉
I will create the PR.
Thank you for your reactivity ! 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants