每次在我的AWS SQS目标上推送通知时如何触发事件? [英] How to trigger an event everytime a notification is pushed on my AWS SQS destination?

查看:151
本文介绍了每次在我的AWS SQS目标上推送通知时如何触发事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用适用于Amazon MWS Order API的AWS SQS.每当有人从将我添加为开发人员的卖家账户订购商品时,Amazon都会将通知发送到我的AWS SQS应用程序.我可以从那里提取通知.但是为此,我将必须创建一个调度程序以拉出通知.每当亚马逊将通知推送到我的目的地时,我是否可以将其他任何AWS用作侦听器来触发我自己的服务?我可以使用Lambda函数吗?我是AWS的新手,所以我对此一无所知.

I am using AWS SQS for Amazon MWS Order APIs. Everytime someone orders from a seller account who has added me as his developer, Amazon will send the notification to my AWS SQS Application.I can pull the notifications from there. But for this, I will have to create a scheduler to pull the notifications. Can I use any other AWS as a listener just to trigger my own service everytime a notification is pushed on my destination by Amazon? Can I use Lambda functions for it? I am new to AWS so I know only I little about it.

推荐答案

是的,您可以使用lambda.具体来说,您可以在SQS之间设置事件源映射队列和lambda函数.

Yes, you can use lambda. Specifically you can setup Event Source Mapping between your SQS queue and lambda function.

在这种情况下,Lambda服务将为您拉出SQS队列,并在有消息时调用您的函数.从某种意义上讲,您不必做任何事情,就不必担心实现拉程序.

In this scenario, the Lambda service will be pulling the SQS queue for you, and invoking your function whenever there are messages. You don't have to do anything, in a sense that you don't have to worry about implementing pulling procedure.

Lambda服务负责拉动.如果您的功能成功完成,它将也从队列中删除该消息.因此,您不必从队列中明确删除消息.

Lambda service takes care of pulling. It will also remove the message from queue if your function completes successful. Thus you don't have to expliclitly delete messages from the queue.

这篇关于每次在我的AWS SQS目标上推送通知时如何触发事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆