awspring / spring-cloud-aws

The New Home for Spring Cloud AWS
http://awspring.io
Apache License 2.0
859 stars 293 forks source link

Invalid parameter passed error for ReceiveMessageRequest when testing with elasticmq - SQS 3.0.0-M2 #529

Closed magna25 closed 1 year ago

magna25 commented 1 year ago

Type: Bug

Component: SQS

Describe the bug When using @SqsListener and elasticmq for testing with standard queue, the listener doesn't fetch messages and throws an error, "Value for parameter ReceiveRequestAttemptId is invalid. The request include parameter that is not valid for this queue type...".

CreateRequest() method in SqsMessageSource.java sets this property for both FIFO and standard queues but this field only applies to FIFO queues.

From the docs:

--receive-request-attempt-id (string)

This parameter applies only to FIFO (first-in-first-out) queues.
tomazfernandes commented 1 year ago

Just to clarify this a bit, both AWS and LocalStack APIs do not complain about this parameter, so it was left for standard queues as well to reduce overall complexity.

Also, the docs state it doesn’t apply, not that it’s prohibited and should throw an error.

But since the elastic mq API does complain, I think that’s reason enough to change this and remove the parameter for standard queues.

maciejwalkowiak commented 1 year ago

@magna25 feel free to submit a PR. Since we work in tests with Localstack this is not a high priority for us.

maciejwalkowiak commented 1 year ago

Fixed in #586