Greengrass V2 deployment topics?

0

I am attempting to update a thing shadow when a deployment completes with the components & versions that are installed on the device. The way it's set up now is:

  1. An IoT rule that subscribes to SELECT * FROM '$aws/events/jobExecution/+/succeeded' and sends the message to a Lambda
  2. The Lambda takes the event, calls the listInstalledComponents api from the Greengrass sdk, then calls the updateThingShadow with the components.

However when the Lambda runs, the installed components that get updated in the shadow are not updated with the latest components. It's almost like the Lambda is run before the component listing is updated. I can see that the component listing in the AWS console updated as soon as the deployment is finished.

I'm wondering if there's a better topic to watch, or if there's some other way to do what I need. Any guidance would be appreciated.

已提问 2 年前219 查看次数
1 回答
0

Hi. I'm told that listInstalledComponents is eventually consistent. I think one way to deal with this might be to handle it similar to the recommended handling of disconnect lifecycle events. See Handling client disconnections here: https://docs.aws.amazon.com/iot/latest/developerguide/life-cycle-events.html

In short, insert an SQS delay queue between the event and the Lambda: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-delay-queues.html

profile pictureAWS
专家
Greg_B
已回答 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容