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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠