Aws-sdk-java: Error when using AmazonSQSBufferedAsyncClient to send messages to FIFO queue

Created on 26 Sep 2017  Â·  7Comments  Â·  Source: aws/aws-sdk-java

We are getting this error when we try to send messages using the buffered client.

Exception in thread "main" com.amazonaws.services.sqs.model.AmazonSQSException: The request must contain the parameter MessageGroupId. (Service: AmazonSQS; Status Code: 400; Error Code: InvalidParameterValue; Request ID: eb0020ee-13e6-5792-aa99-72aad3a2832c)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1638)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1303)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1055)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:743)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:717)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:699)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:667)
    at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:649)
    at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:513)
    at com.amazonaws.services.sqs.AmazonSQSClient.doInvoke(AmazonSQSClient.java:1740)
    at com.amazonaws.services.sqs.AmazonSQSClient.invoke(AmazonSQSClient.java:1716)
    at com.amazonaws.services.sqs.AmazonSQSClient.executeSendMessageBatch(AmazonSQSClient.java:1607)
    at com.amazonaws.services.sqs.AmazonSQSClient.sendMessageBatch(AmazonSQSClient.java:1583)
    at com.amazonaws.services.sqs.buffered.SendQueueBuffer$SendMessageBatchTask.process(SendQueueBuffer.java:512)
    at com.amazonaws.services.sqs.buffered.SendQueueBuffer$OutboundBatchTask.run(SendQueueBuffer.java:443)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

If we change to AmazonSQSAsync the message is sent successfully.

bug

All 7 comments

Can you provide the code you're using to send via sync vs async? The async client delegates to the sync one internally, so I wouldn't expect them to behave differently.

The call to AmazonSQSAsync won't fail immediately, but the future/async handler should eventually received the same exception if you're using the same request.

I'm experiencing this as well, in my case the culprit is the process() method in SendMessageBatchTask when using the AmazonSQSBufferedAsyncClient. When it converts my SendMessageRequest to a SendMessageBatchRequestEntry it doesn't carry across the MessageGroupId or MessageDeduplicationId.

Exactly, and I was searching about it and found out that there's a pull
request to fix this, but even when I tried to create my custom Object with
the updates from this pull request which is not in master branch yet, I
also got a failure message regarding message-group-id. Then I tried to
override the Bean AmazonSQSAsync to avoid using batch processing and it
worked, but now the performance declined.

You can try to use AmazonSQSAsyncClient, that works fine, instead of using
AmazonSQSBufferedAsyncClient.
However, there's the performance impact using the one that works.

--
https://www.ebanx.com/
Angela c. pereira
Web Developer
+55 (41) 99863-1250 <+55+(41)+3044-8471>

https://www.ebanx.com/br
Privileged and confidential. If this message has been received in error,
notify the sender and delete it.

On Fri, Sep 29, 2017 at 9:31 AM, Neil Rutherford notifications@github.com
wrote:

I'm experiencing this as well, in my case the culprit is the process()
method in SendMessageBatchTask when using the AmazonSQSBufferedAsyncClient.
When it converts my SendMessageRequest to a SendMessageBatchRequestEntry it
doesn't carry across the MessageGroupId or MessageDeduplicationId.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/aws/aws-sdk-java/issues/1316#issuecomment-333113550,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AeKnu1huzCHnF_WWeSEbOzqE6jY4-cqoks5snOMpgaJpZM4Pk3q2
.

@AngelaCPereira Yip! That's what I've done for the time being

Ah, I'm sorry - I missed that this was the buffered client! We'll see what we can do to fix this issue.

Thanks for reporting this bug. It is fixed in v1.11.209. Please try it out and let us know if you still have the issue. Resolving.

The docs here http://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues.html#FIFO-queues-moving still mention:

The Amazon SQS Buffered Asynchronous Client doesn't currently support FIFO queues.

Was this page helpful?
0 / 5 - 0 ratings