amazon-sqs

Can I trigger same AWS lambda from multiple SQS?

匆匆过客 提交于 2020-01-30 12:11:08
问题 I want to trigger a lambda function from multiple SQS queues. Most of the processing the lambda will do is same, just one small step will be based on the table name. I don't want to maintain two separate lambda for that. What's the pros and cons of having same/multiple lambda? 回答1: Yes there's no reason you can't configure it that way. It should work fine. 来源: https://stackoverflow.com/questions/59397753/can-i-trigger-same-aws-lambda-from-multiple-sqs

SQS Message Delay Not Working As Expected

烂漫一生 提交于 2020-01-30 11:27:07
问题 I'm trying send individual SQS messages with a delay. Using https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-send-message-with-timer.html to test message delays, I'm not seeing any delay. If I set a delay on the queue, that delay is honoured, however not for individual messages. I'm doing the following (all from the AWS console): Open the SQS console and right click on my test queue - verify that there the delay value for the queue is 0. Right click on the test

AWS Lambda for transformation of messages

感情迁移 提交于 2020-01-17 07:06:53
问题 My architecture is something like as: SNS -> AWS Lambda -> Dynamo Db SNS is publishing messages to which AWS Lambda function is the subscriber and then AWS Lambda pushes the data into Dynamo Db. Is AWS Lambda good for doing transformations? Eg. I wanted to transform the message received by AWS Lambda to some other form and then pass it to downstream systems. By 'good', I mean is it normally done in AWS Lambda or for transformation, or I should use SQS Consumer probably for that? 来源: https:/

BBC Consumer SQS Issues

耗尽温柔 提交于 2020-01-17 01:10:29
问题 I'm using the sqs-consumer node module package. I have the following code: init: function () { var app = Consumer.create({ queueUrl: Settings.getSetting("sendgrid-aws-sqs-queue"), batchSize: 1, visibilityTimeout: 30, waitTimeSeconds: 20, sqs: MarvelAWS.sqs, handleMessage: function (message, done) { try { var msgBody; try { msgBody = JSON.parse(message.Body); } catch (err) { msgBody = null; this._warn("parsing error handling SQS queue " + err, msgBody); } var environment = Settings.getSetting(

How to add a new statement to an existing SQS QueuePolicy from another template?

孤街浪徒 提交于 2020-01-16 09:19:29
问题 I have 2 services with different Cloudformation YAML templates and want to add another policy to a queue policy defined in producer service (to allow consumer to receive and delete messages). However, my current solution simply overrides the existing policy instead of appending it (i. e., only consumer service role remains in the policy). This is Cloudformation template SQS part for producer: ProducerQueuePolicy: Type: AWS::SQS::QueuePolicy Properties: PolicyDocument: Version: '2012-10-17' Id

Best way to delete messages from SQS during development

徘徊边缘 提交于 2020-01-14 06:58:08
问题 During development, I'm generating a lot of bogus messages on my Amazon SQS. I was about to write a tiny app to delete all the messages (something I do frequently during development). Does anyone know of a tool to purge the queue? 回答1: If you don't want to write script or delete your queue. You can change the queue configuration: Right click on queue > configure queue Change Message Retention period to 1 minute (the minimum time it can be set to). Wait a while for all the messages to

How do I return a message back to SQS from lambda trigger

随声附和 提交于 2020-01-14 05:33:08
问题 I have lambda trigger that reads messages from SQS queue. In some conditions, the message may not be ready for processing so I'd like to put the message back in queue for 1min and try again. Currently, I am create another copy of this customer record and posting this new copy in the queue. Is there a reason/way for me to keep the original record in queue as opposed to creating a new one def postToQueue(customer): if 'attemptCount' in customer.keys(): attemptCount = int(customer["attemptCount"

SQS Cloudwatch Sanity

拟墨画扇 提交于 2020-01-13 19:36:08
问题 I'm analyzing a recent load event on my SQS consumer service and am stuck with some SQS Cloudwatch metrics that don't make sense to me. Essentially, it looks like the queue was getting overloaded with messages that aren't accounted for in the metrics. Let me start by summarizing the data in a selected 5 minute period: ApproximateNumberOfMessagesVisible: 215,686 -> 233,605 (gain of 17,919 for this period) ApproximateNumberOfMessagesNotVisible: 2,239 -> 2,129 (loss of 110 for this period)

Amazon SQS Tagging

若如初见. 提交于 2020-01-13 10:15:33
问题 We are trying to setup Amazon SQS between two AWS applications. Management wants to track cost associated with all Amazon resources. Is it possible to tag Amazon Simple Queue Service resources? 回答1: This feature is now supported on SQS: https://aws.amazon.com/blogs/aws/introducing-cost-allocation-tags-for-amazon-sqs/ 回答2: Tagging for SQS is not yet supported. Perhaps you may manually calculate using the standard formula with few assumption of number of requests made like number of SQS Request

AWS SQS trigger Step Functions

自作多情 提交于 2020-01-13 10:13:50
问题 Quick question: Is it possible to trigger the execution of a Step Function after an SQS message was sent?, if so, how would you specify it into the cloudformation yaml file? Thanks in advance. 回答1: The first think to consider is this: do you really need to use SQS to start a Step Functions state machine? Can you use API gateway instead? Or could you write your messages to a S3 bucket and use the CloudWatch events to start a state machine? If you must use SQS, then you will need to have a