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

Adding support for other HTTP clients #137

Open
ajutzeler opened this issue Nov 5, 2021 · 4 comments
Open

Adding support for other HTTP clients #137

ajutzeler opened this issue Nov 5, 2021 · 4 comments

Comments

@ajutzeler
Copy link

HttpsURLConnection is not very flexible (and even broken in my opinion) when it comes to the persistence of the connections.

On all JVM that I tested (openjdk 11-17, oracle 11-17) there is a timeout around 10 seconds, which to my knowledge is not configurable, that will terminate the connection if no subsequent query is sent regardless of OS' configuration.

I quickly and dirtily (dropped all features I did not need and did not update the test suite) modified ResCU to use OKHttp client instead of HttpsURLConnection and all my problems related to that issue disappeared.

Would that make sense to add to this project the support for a more capable HTTP client (not necessarily OKHttp)?

@timmolter
Copy link
Collaborator

Did you try this: https://github.com/mmazi/rescu#settings

@ajutzeler
Copy link
Author

I did not try to specify explicitly any value, but I was using the 30 secs default values (see class Config in si.mazi.rescu).

In my tests no connection ever lasted 30 secs if queries were not continuously sent around every 10 seconds. The connection timeout is supposed to only be relevant at the initialization (see official javadoc).

@mmazi
Copy link
Owner

mmazi commented Nov 8, 2021

Would that make sense to add to this project the support for a more capable HTTP client (not necessarily OKHttp)?

It certainly seems so. Would you be willing to create a full pull request? That would have to include the tests too. I'd be happy to review it and help with some advice (and perhaps a little coding).

@pcoppinger
Copy link

I quickly and dirtily (dropped all features I did not need and did not update the test suite) modified ResCU to use OKHttp client instead of HttpsURLConnection and all my problems related to that issue disappeared.

@ajutzeler I'm having the same problem. What is involved in converting ResCU to OKHttp? Any help (or code) you could offer would be very much appreciated.

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

No branches or pull requests

4 participants