java - Amazon sqs throwing exception connection reset -


i using amazonsqsasyncclient connect amazon sqs, see following execution in logs:

info  [amazonhttpclient:444] unable execute http request: connection reset java.net.socketexception: connection reset     @ java.net.socketinputstream.read(socketinputstream.java:168)     @ com.sun.net.ssl.internal.ssl.inputrecord.readfully(inputrecord.java:293)     @ com.sun.net.ssl.internal.ssl.inputrecord.read(inputrecord.java:331)     @ com.sun.net.ssl.internal.ssl.sslsocketimpl.readrecord(sslsocketimpl.java:798)     @ com.sun.net.ssl.internal.ssl.sslsocketimpl.readdatarecord(sslsocketimpl.java:755)     @ com.sun.net.ssl.internal.ssl.appinputstream.read(appinputstream.java:75)     @ org.apache.http.impl.io.abstractsessioninputbuffer.fillbuffer(abstractsessioninputbuffer.java:166)     @ org.apache.http.impl.io.socketinputbuffer.fillbuffer(socketinputbuffer.java:90)     @ org.apache.http.impl.io.abstractsessioninputbuffer.readline(abstractsessioninputbuffer.java:281)     @ org.apache.http.impl.conn.defaulthttpresponseparser.parsehead(defaulthttpresponseparser.java:92)     @ org.apache.http.impl.conn.defaulthttpresponseparser.parsehead(defaulthttpresponseparser.java:62)     @ org.apache.http.impl.io.abstractmessageparser.parse(abstractmessageparser.java:254)     @ org.apache.http.impl.abstracthttpclientconnection.receiveresponseheader(abstracthttpclientconnection.java:289)     @ org.apache.http.impl.conn.defaultclientconnection.receiveresponseheader(defaultclientconnection.java:252)     @ org.apache.http.impl.conn.managedclientconnectionimpl.receiveresponseheader(managedclientconnectionimpl.java:191)     @ org.apache.http.protocol.httprequestexecutor.doreceiveresponse(httprequestexecutor.java:300)     @ com.amazonaws.http.protocol.sdkhttprequestexecutor.doreceiveresponse(sdkhttprequestexecutor.java:66)     @ org.apache.http.protocol.httprequestexecutor.execute(httprequestexecutor.java:127)     @ org.apache.http.impl.client.defaultrequestdirector.tryexecute(defaultrequestdirector.java:712)     @ org.apache.http.impl.client.defaultrequestdirector.execute(defaultrequestdirector.java:517)     @ org.apache.http.impl.client.abstracthttpclient.execute(abstracthttpclient.java:906)     @ org.apache.http.impl.client.abstracthttpclient.execute(abstracthttpclient.java:805)     @ com.amazonaws.http.amazonhttpclient.executehelper(amazonhttpclient.java:380)     @ com.amazonaws.http.amazonhttpclient.execute(amazonhttpclient.java:229)     @ com.amazonaws.services.sqs.amazonsqsclient.invoke(amazonsqsclient.java:2169)     @ com.amazonaws.services.sqs.amazonsqsclient.getqueueurl(amazonsqsclient.java:468)     @ com.amazonaws.services.sqs.amazonsqsclient.getqueueurl(amazonsqsclient.java:1476) 

i using amazonsqsasyncclient through out application singleton.

code snippet below.

static{         if(sqsobj == null){         sqsobj = new amazonsqsasyncclient(new classpathpropertiesfilecredentialsprovider("app.properties"));         sqsobj.setregion(region.getregion(regions.valueof("sample region"));     } } 

by using sqsobj, doing operations create queue, send message , receive messages. works fine time throws exception above. after restarting application works fine sometime.

i using aws-java-sdk-1.7.1. please suggest on this.

the "connection reset" means other party (i.e. server) closed connection.

internally sdk builds , reuses http connection not have open connection every time make request.

the log message tells connection reset, not worry about. sdk retry automatically in cases this. if seeing sporadically in logs works expected should not worry it


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -