title: auto connect in case of error
body: <p>i am working on android app , I often get HTTP error 500 when i try to access the url due to bad connectivity which causes my app to fail . Response returned from URL is in JSON format so in order to Parse this json i used jackson api</p>
  
  <pre><code>JsonNode monthlyUrlNode  = objectMapper.readValue(url, JsonNode.class);
  </code></pre>
  
  <p><strong>In case of failure i want to reconnect to url with a delay of 30 seconds</strong> </p>
  
  <p>i referred this <a href="https://stackoverflow.com/questions/7312794/retry-a-connection-on-timeout-in-java">Retry a connection on timeout in Java</a> , but it is not of much use to me </p>