有没有办法在数据库中插入 n 次后创建 CloudWatch 事件
目前,我有许多 lambda 函数调用,这些函数是在 SQS 队列中存在消息时调用的。这些 lambda 函数将数据插入数据库。我需要一种在处理完所有消息后触发 lambda 函数的方法。我的想法是在数据库中发生所有 n 个插入操作后创建一个 Cloudwatch 事件,但我找不到表明这是可能的文档。这是解决这个问题的好方法吗?在数据库表上发生 N 次插入后是否可以创建 Cloudwatch 事件?
I currently have many invocations of lambda functions that are invoked when messages are present in an SQS queue. These lambda functions insert data into a database. I need a way to trigger a lambda function after all messages have been processed. My thought was to create a Cloudwatch Event after all n insert operations happen in the database, but I cannot find documentation that shows this is possible. Would this be a good way to go about this problem? And is it possible to create a Cloudwatch event after N inserts happen on a database table?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过以下步骤解决此问题:
近似emimatenumberofmessages Visible
度量指标等于零(意味着SQS队列为空)请注意,标准队列的指标是“近似”;如果您想要精确性,则需要一个FIFO队列。从
但是,您应该能够通过配置警报的示例时间足够长的时间来减轻这种情况。
You can solve this problem with the following steps:
ApproximateNumberOfMessagesVisible
metric is equal to zero (meaning the SQS queue is empty)Do note that the metrics for a standard queue are "approximate"; if you want exactness you need a FIFO queue. From the documentation:
You should, however, be able to mitigate this by configuring the sample period of the alarm to be long enough.