asolfre / typica

Automatically exported from code.google.com/p/typica
Apache License 2.0
0 stars 0 forks source link

MessageQueue class doesn't respect MAX_MESSAGE_BODIES_SIZE constant #71

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Attempt sending a message over 8KB (SQS's max message size)

What is the expected output? What do you see instead?
I would expect to be told that my message body is too large.  Instead, I
get this stack trace:

 Caused by: org.apache.commons.httpclient.HttpException: Number of retries
exceeded : SendMessage 
 at
com.xerox.amazonws.common.AWSQueryConnection.makeRequest(AWSQueryConnection.java
:436)

 at com.xerox.amazonws.sqs2.MessageQueue.makeRequestInt(MessageQueue.java:481) 
 ... 10 more 
 Caused by: com.xerox.amazonws.common.AWSException: Connection reset 
 at
com.xerox.amazonws.common.AWSQueryConnection.makeRequest(AWSQueryConnection.java
:407)

 ... 11 more 
 Caused by: java.net.SocketException: Connection reset 
 at java.net.SocketInputStream.read(SocketInputStream.java:168) 
 at com.sun.net.ssl.internal.ssl.InputRecord.readFully(InputRecord.java:293) 
 at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:331) 
 at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:789) 
 at
com.sun.net.ssl.internal.ssl.SSLSocketImpl.readDataRecord(SSLSocketImpl.java:746
)

 at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:75) 
 at java.io.BufferedInputStream.fill(BufferedInputStream.java:218) 
 at java.io.BufferedInputStream.read(BufferedInputStream.java:237) 
 at org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78) 
 at org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106) 
 at
org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)

 at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionA
dapter.readLine(MultiThreadedHttpConnectionManager.java:1413)

 at
org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:
1973)

 at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:17
35)

 at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1098) 
 at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDire
ctor.java:398)

 at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirecto
r.java:171)

 at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397) 
 at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323) 
 at
com.xerox.amazonws.common.AWSQueryConnection.makeRequest(AWSQueryConnection.java
:403)

 ... 11 more }

What version of the product are you using? On what operating system?
1.6 - Mac OS X and Linux

Please provide any additional information below.
There are no references to com.xerox.amazonws.sqs2.MAX_MESSAGE_BODIES_SIZE
in the Typica package.  In addition, this constant should correspond with
8KB, not 4.

Original issue reported on code.google.com by Big...@gmail.com on 23 Nov 2009 at 5:22

GoogleCodeExporter commented 9 years ago
I would be happy to code this change up with a unit test.  What would be the
procedure for getting it reviewed and submitting the change?

Original comment by Big...@gmail.com on 23 Nov 2009 at 5:24

GoogleCodeExporter commented 9 years ago
I've put in a test, so the encoded message is checked for size. The error 
message 
indicates if encoding was enabled, to help the user understand.

Original comment by dkavan...@gmail.com on 23 Mar 2010 at 10:55