flagsmith-java-client icon indicating copy to clipboard operation
flagsmith-java-client copied to clipboard

Allow disabling of HTTP/2 support

Open olivier-hubaut opened this issue 1 year ago • 1 comments

The client uses okhttp3, which supports, by default, HTTP/2 and HTTP/1.1 protocol, through protocol negotiation.

Unfortunately, on networks with variable latency, it often happen that the negotiation fails, and the call to Flagsmith server ends up in error.

This is a recurring problem with okhttp3 (and how HTTP/2 handle the initial connection) that has been documented in several places:

  • https://www.twilio.com/en-us/blog/http2-issues-html
  • https://github.com/square/okhttp/issues/3955

The proposed change is to augment the FlagsmithConfig.Builder class to allow selection of supported protocols.

olivier-hubaut avatar Jul 19 '24 09:07 olivier-hubaut

Interesting, thanks for the details here @olivier-hubaut . We will add this into our backlog, but equally we're happy to receive a PR on this.

matthewelwell avatar Jul 19 '24 09:07 matthewelwell

Hi!

I submitted the PR one month ago. Is there something I should adapt? As of now, this issue is problematic for us. So much that we now use a patched version of the java client in our applications.

olivier-hubaut avatar Aug 19 '24 06:08 olivier-hubaut

@olivier-hubaut this has just been released as part of v7.4.0.

matthewelwell avatar Aug 20 '24 08:08 matthewelwell