title: Jersey 2.7 - setting retry handler
body: <p>I would like to set a retry handler for <code>Jersey</code> client utilizing <code>ApacheConnector</code>. I wish to do it, because I want it to retry on timeout (my HAProxy will switch it to another server). I have no clue how to do this in <code>Jersey 2.7</code>.</p>
  
  <p>Example code:</p>
  
  <pre><code>public static void Example() {
  
      ClientConfig clientConfig = new ClientConfig();
      clientConfig.connectorProvider(new ApacheConnectorProvider());
      clientConfig.property(ApacheClientProperties.CONNECTION_MANAGER, new PoolingHttpClientConnectionManager());
  
      RequestConfig reqConfig = RequestConfig.custom().build(); 
      clientConfig.property(ApacheClientProperties.REQUEST_CONFIG, reqConfig);
  
      Client client = ClientBuilder.newClient(clientConfig);
      WebTarget apiTarget = client.target("http://127.0.0.1/rest");
      System.out.println(apiTarget.path(ApiConstant.PING)
              .path(ApiConstant.PING1)
              .request(MediaType.TEXT_PLAIN)
              .get(String.class));
  }
  </code></pre>
  
  <p>How, using this code, I can set a retry handler to send request again if server responds with an error? Is it possible?</p>