Questions tagged with Amazon Simple Queue Service

Content language: English

Sort by most recent

Browse through the questions and answers listed below or filter and sort to narrow down your results.

API Gateway as Reverse HTTP Proxy to SQS

I am trying to use AWS API Gateway as a reverse (forwarding) proxy to AWS SQS. I essentially want to send a REST request to the API Gateway which then gets forwarded directly to the SQS REST API and returns the response. When I send a request to the gateway, I immediately get back ```xml <?xml version="1.0"?> <ErrorResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/"> <Error> <Type>Sender</Type> <Code>AccessDenied</Code> <Message>Access to the resource https://sqs.us-east-1.amazonaws.com/ is denied.</Message> <Detail/> </Error> <RequestId>51c903b2-4da3-5d5e-a3b8-589ee72167de</RequestId> </ErrorResponse> ``` However, when I switch the request URL to SQS directly (`https://sqs.us-east-1.amazonaws.com`) the request succeeds. What am I missing? ```shell curl --request POST 'https://my-api-gateway.com/sqs' \ --header 'X-Amz-Date: <date>' \ --header 'X-Amz-Security-Token: <token>' \ --header 'Authorization: <auth>' \ --header 'Amz-Sdk-Invocation-Id: <invocation>' \ --header 'Amz-Sdk-Request: attempt=1; max=10' \ --header 'User-Agent: aws-sdk-go-v2/1.16.5 os/macos lang/go/1.18.3 md/GOOS/darwin md/GOARCH/arm64 api/sqs/1.18.6' \ --header 'Content-Length: 206' \ --data-urlencode 'Action=ReceiveMessage' \ --data-urlencode 'MaxNumberOfMessages=10' \ --data-urlencode 'QueueUrl=<my-queue-url>' \ --data-urlencode 'Version=2012-11-05' \ --data-urlencode 'WaitTimeSeconds=20' ``` Configuration: 1. [Integrations](https://i.stack.imgur.com/geLqx.png) 2. [Routes](https://i.stack.imgur.com/Lk3QQ.png) 3. [Parameter Mappings](https://i.stack.imgur.com/LtCO4.png)
2
answers
0
votes
190
views
asked 5 months ago

Multiple SQS messages of the same group in one batch

Hello, I am getting multiple messages from a same SQS FIFO group in a single receive request with MaxNumberOfMessages set to > 2. Is this correct behavior? I don't understand, the API contract says: *When receiving messages from a FIFO queue with multiple message group IDs, Amazon SQS first attempts to return as many messages with the same message group ID as possible. This allows other consumers to process messages with a different message group ID. When you receive a message with a message group ID, **no more messages for the same message group ID are returned unless you delete the message** or it becomes visible.* https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/FIFO-queues-understanding-logic.html My code dispatches the messages directly to the workers without any group checking logic. It looks like I either need to implement such feature, or simply make all SQS receive requests with maxMessages set to 1 which sounds like a waste of resources. I am confused, because on the very same documentation page that says above, there is this box: *It is possible to receive **up to 10 messages in a single call** using the MaxNumberOfMessages request parameter of the ReceiveMessage action. These messages retain their FIFO order and **can have the same message group ID**.* That breaks the above contract which literally says: "unless you delete the message or it becomes visible". In my testing, I see those messages immediately returned in a single receive call, yet they are set to expire in 30 seconds. I don't understand, is there some kind of log that could tell me why a message was delivered that fast? I am probably missing something in here. Thanks for help
1
answers
0
votes
53
views
lzap
asked 5 months ago

Amazon Linux 2 on Beanstalk isn't installing SQSD and prevents cron.yml from working

We're on solution stack "64bit Amazon Linux 2 v3.3.13 running PHP 7.4" the worker server is spinning up, unpacking the "platform-engine.zip" and when it comes to setting up SQSD: ``` May 23 12:45:01 ip-172-31-12-195 su: (to sqsd) root on none May 23 12:45:10 ip-172-31-12-195 aws-sqsd-monitor: restarting aws-sqsd... May 23 12:45:10 ip-172-31-12-195 systemd: Starting (null)... May 23 12:45:10 ip-172-31-12-195 su: (to sqsd) root on none May 23 12:45:10 ip-172-31-12-195 systemd: Created slice User Slice of sqsd. May 23 12:45:10 ip-172-31-12-195 systemd: Started Session c2 of user sqsd. May 23 12:45:10 ip-172-31-12-195 aws-sqsd: Version 2 of the Ruby SDK will enter maintenance mode as of November 20, 2020. To continue receiving service updates and new features, please upgrade to Version 3. More information can be found here: https://aws.amazon.com/blogs/developer/deprecation-schedule-for-aws-sdk-for-ruby-v2/ May 23 12:45:13 ip-172-31-12-195 aws-sqsd: Cannot load config file. No such file or directory: "/etc/aws-sqsd.d/default.yaml" - (AWS::EB::SQSD::FatalError) May 23 12:45:13 ip-172-31-12-195 systemd: aws-sqsd.service: control process exited, code=exited status=1 May 23 12:45:13 ip-172-31-12-195 systemd: Failed to start (null). May 23 12:45:13 ip-172-31-12-195 systemd: Unit aws-sqsd.service entered failed state. May 23 12:45:13 ip-172-31-12-195 systemd: aws-sqsd.service failed. May 23 12:45:13 ip-172-31-12-195 systemd: Removed slice User Slice of sqsd. ``` I can't find anything online about this, so some help would be greatly appreciated.
1
answers
0
votes
126
views
cwilson
asked 6 months ago