title: Connection to SQS refused
body: <p>I am developing a service which reads messages from SQS, does some processing and posts the result to a different service.</p>
  
  <p>When I initially developed this, the service was working perfectly fine, however after some days (about 5 days) I got this exception:</p>
  
  <pre><code>com.amazonaws.http.AmazonHttpClient: Unable to execute HTTP request: Connection to https://sqs.us-east-1.amazonaws.com refused { org.apache.http.conn.HttpHostConnectException: Connection to https://sqs.us-east-1.amazonaws.com refused
      at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:158)
      at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:149)
      at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
      at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:561)
      at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:415)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
      at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:732)
      at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:280)
      at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:165)
      at com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:869)
      at com.amazonaws.services.sqs.AmazonSQSClient.getQueueAttributes(AmazonSQSClient.java:453)
  </code></pre>
  
  <p>I reactivated the service and it started working again. My question is has someone faced this issue? If so what is the best way to handle such exception?</p>
  
  <p>Other interesting fact is the same exception happened on all the hosts of the service at nearly the same time. Can this be because of an SQS outage or are such transient connection failures expected?</p>