Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are Retrofit and OkHttp suitable for Java EE/Server-side use?

I like the APIs of the Retrofit and OkHttp rest/http libraries from Square. I am evaluating options for writing a server-side rest client. For each request to my SOAP-based web service, I have to consume another, restful web service, thus my need for a rest client.

My question is, are Retrofit and OkHttp suitable for server-side use in a highly concurrent web app, or are there likely to be issues, known or otherwise, stemming from these APIs having been designed for use primarily outside of the server-side?

Reading the documentation and perusing the code, nothing jumped out at me to indicate that these libraries would not be suitable. But I don't want to be a guinea pig either. Has anyone experienced any issues with server-side use under high load/concurrency? Had success? Anyone from the dev teams for those libraries care to comment? ;)

like image 502
rees Avatar asked Mar 07 '15 16:03

rees


2 Answers

We use OkHttp on the Square Cash server and we haven't had problems.

like image 170
Jesse Wilson Avatar answered Oct 12 '22 23:10

Jesse Wilson


Some of the default settings are not suitable for server side usage, for example, the maximum number of concurrent requests per host defaults to 5.

There is some discussion on this at https://github.com/square/okhttp/issues/4354.

like image 39
Adrian Baker Avatar answered Oct 12 '22 22:10

Adrian Baker