无法在Elasticmq嵌入式服务器上发送长字符串

时间:2018-07-25 05:33:21

标签: elastic-mq

无法在 EMBEDDED弹性mq服务器上发送长字符串。

mocksqsRestServerserver = SQSRestServerBuilder.withPort(9324).withInterface(“ localhost”)。start(); mocksqsRestServerserver.waitUntilStarted();

https://github.com/adamw/elasticmq/issues/146

https://github.com/adamw/elasticmq/blob/master/rest/rest-sqs/src/main/scala/org/elasticmq/rest/sqs/SendMessageDirectives.scala

def verifyMessageNotTooLong(messageLength: Int) {
  ifStrictLimits(messageLength > 262144) {
  "MessageTooLong"
}

}

String theString2 = IOUtils.toString(new FileInputStream(new File(“ / Users / sanjiv / Desktop / test.txt”)))); 字符串长度- 72093

无法在队列上发送数据。

例外-

2018-07-24--09-07-32-264 [FIS TR:SP:RIP:LIP:T:U:D:S:] [SQSQueueBufferWorkerThread-7]错误com。<***** *******>-发送报告队列失败: com.amazonaws.services.sqs.model.AmazonSQSException:MessageTooLong;请参阅SQS文档。 (服务:AmazonSQS;状态代码:400;错误代码:MessageTooLong;请求ID:00000000-0000-0000-0000-000000000000) 在com.amazonaws.http.AmazonHttpClient $ RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1586) 在com.amazonaws.http.AmazonHttpClient $ RequestExecutor.executeOneRequest(AmazonHttpClient.java:1254) 在com.amazonaws.http.AmazonHttpClient $ RequestExecutor.executeHelper(AmazonHttpClient.java:1035) 在com.amazonaws.http.AmazonHttpClient $ RequestExecutor.doExecute(AmazonHttpClient.java:747) 在com.amazonaws.http.AmazonHttpClient $ RequestExecutor.executeWithTimer(AmazonHttpClient.java:721) 在com.amazonaws.http.AmazonHttpClient $ RequestExecutor.execute(AmazonHttpClient.java:704) 在com.amazonaws.http.AmazonHttpClient $ RequestExecutor.access $ 500(AmazonHttpClient.java:672) 在com.amazonaws.http.AmazonHttpClient $ RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:654) 在com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:518) 在com.amazonaws.services.sqs.AmazonSQSClient.doInvoke(AmazonSQSClient.java:1665) 在com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:1641) 在com.amazonaws.services.sqs.AmazonSQSClient.sendMessageBatch(AmazonSQSClient.java:1538) 在com.amazonaws.services.sqs.buffered.SendQueueBuffer $ SendMessageBatchTask.process(SendQueueBuffer.java:512) 在com.amazonaws.services.sqs.buffered.SendQueueBuffer $ OutboundBatchTask.run(SendQueueBuffer.java:443) 在java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) 在java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624) 在java.lang.Thread.run(Thread.java:748)

enter image description here

0 个答案:

没有答案