Hey,
I, unfortunately, do not have a single clue where I should start to search for the issue. I hope you can point me into the right direction.
Thanks in advance.
Sascha
try (final AsyncHttpClient asyncHttpClient = new DefaultAsyncHttpClient()) { final BoundRequestBuilder requestBuilder = asyncHttpClient.prepareGet(avatarUrl); final Future<Response> featureResponse = requestBuilder.execute(); final Response response = featureResponse.get(); final InputStream responseBodyAsStream = response.getResponseBodyAsStream();
return ok(responseBodyAsStream).as("image/jpg");} catch (Exception e) { return notFound();}
WSClient
manually then you must call client.close()
to clean it up when you’ve finished with it. Each client creates its own thread pool. If you fail to close the client or if you create too many clients then you will run out of threads or file handles -— you’ll get errors like “Unable to create new native thread” or “too many open files” as the underlying resources are consumed."