AmazonServiceException when reading or writing from/to the queue

3,413 views
Skip to first unread message

Shantanu Kumar

unread,
Jul 2, 2014, 10:34:39 AM7/2/14
to elas...@googlegroups.com
Hi,

I am able to create a queue, but writing/reading messages is resulting in exception.

I am getting the below exception when writing to the queue:

        sqsClient.sendMessage(sqsQueueURL, "hello there");  // line where exception happens

Exception in thread "main" com.amazonaws.AmazonServiceException: Invalid request: MissingFormFieldRejection(QueueName), MissingQueryParamRejection(QueueName), MissingFormFieldRejection(QueueUrl), MissingQueryParamRejection(QueueUrl); see the SQS docs. (Service: AmazonSQS; Status Code: 400; Error Code: Invalid request: MissingFormFieldRejection(QueueName), MissingQueryParamRejection(QueueName), MissingFormFieldRejection(QueueUrl), MissingQueryParamRejection(QueueUrl); Request ID: 00000000-0000-0000-0000-000000000000)
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:820)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:439)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:245)
at com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:2221)
at com.amazonaws.services.sqs.AmazonSQSClient.sendMessage(AmazonSQSClient.java:867)
at com.amazonaws.services.sqs.AmazonSQSClient.sendMessage(AmazonSQSClient.java:1806)
at com.freecharge.emailapp.config.ComponentFactory.createDataRetriever(ComponentFactory.java:40)
at com.freecharge.emailapp.config.Bootstrap.init(Bootstrap.java:20)
at com.freecharge.emailapp.Main.main(Main.java:15)

I am getting a similar exception when trying to read:

        final ReceiveMessageResult messageResult = amazonSQS.receiveMessage(queueURL); // line where exception happens

com.amazonaws.AmazonServiceException: Invalid request: MissingFormFieldRejection(QueueName), MissingQueryParamRejection(QueueName), MissingFormFieldRejection(QueueUrl), MissingQueryParamRejection(QueueUrl); see the SQS docs. (Service: AmazonSQS; Status Code: 400; Error Code: Invalid request: MissingFormFieldRejection(QueueName), MissingQueryParamRejection(QueueName), MissingFormFieldRejection(QueueUrl), MissingQueryParamRejection(QueueUrl); Request ID: 00000000-0000-0000-0000-000000000000)
at com.amazonaws.http.AmazonHttpClient.handleErrorResponse(AmazonHttpClient.java:820)
at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:439)
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:245)
at com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:2221)
at com.amazonaws.services.sqs.AmazonSQSClient.receiveMessage(AmazonSQSClient.java:973)
at com.amazonaws.services.sqs.AmazonSQSClient.receiveMessage(AmazonSQSClient.java:1900)
at com.freecharge.emailapp.consumer.DefaultDataRetriever.getMessages(DefaultDataRetriever.java:29)
at com.freecharge.emailapp.consumer.Dispatcher.run(Dispatcher.java:62)

Any pointers would be helpful.

Shantanu

Shantanu Kumar

unread,
Jul 2, 2014, 1:18:04 PM7/2/14
to elas...@googlegroups.com
I should add -- I am using:

- elasticmq-server_2.11 version 0.8.2 as a standalone server on 64-bit Linux Sun JDK
- AWS Java SDK 1.8.1 on the client on 64-bit Linux Sun JDK

Shantanu

Adam Warski

unread,
Jul 2, 2014, 2:45:34 PM7/2/14
to elas...@googlegroups.com
Weird :) How do you obtain the queueURL? Could you post a full failing snippet?

Adam

--

---
You received this message because you are subscribed to the Google Groups "ElasticMQ" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticmq+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Shantanu Kumar

unread,
Jul 2, 2014, 3:06:45 PM7/2/14
to elas...@googlegroups.com


On Thursday, 3 July 2014 00:15:34 UTC+5:30, Adam Warski wrote:
Weird :) How do you obtain the queueURL? Could you post a full failing snippet?

The queue URL at the time of sending and reading messages is: http://localhost:9324/email

I take the queue URL from a properties (configuration) file. There's not much else beside the call (listed in the original post in this thread) that sends or reads the message.

Shantanu

Adam Warski

unread,
Jul 2, 2014, 3:12:26 PM7/2/14
to elas...@googlegroups.com
You should use the queue URL obtained via GetQueueUrl or CreateUrl.
As far as I remember it will be sth like http://localhost:9324/queue/email

Adam

Shantanu Kumar

unread,
Jul 2, 2014, 3:21:18 PM7/2/14
to elas...@googlegroups.com


On Thursday, 3 July 2014 00:42:26 UTC+5:30, Adam Warski wrote:
You should use the queue URL obtained via GetQueueUrl or CreateUrl.
As far as I remember it will be sth like http://localhost:9324/queue/email

Thank you, it worked!
Reply all
Reply to author
Forward
0 new messages