HttpClient error handling
In the end there was no need to retry manually httpclient has a retry handler.

    HttpRequestRetryHandler retryhandler = new DefaultHttpRequestRetryHandler(6, true);

    httpClient.setHttpRequestRetryHandler(retryhandler);