1 Answer
- Newest
- Most votes
- Most comments
0
Hello,
Lambda in V1 never had any presence events. Both of the events that you're talking about for thingname and thingname-c00 are from Greengrass itself and has nothing to do with your lambda running or not running. Greengrass V1 always had 2 MQTT connections named for the thing name and thing name with c00.
Greengrass V2 has only 1 MQTT connection which is named with the thing name.
If you want to check if your deployment is successful, then simply check the deployment status, not MQTT presence. https://awscli.amazonaws.com/v2/documentation/api/latest/reference/greengrassv2/get-deployment.html
Cheers,
Michael
Relevant content
- asked 4 years ago
- Accepted Answerasked 8 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a month ago
I'm sorry I probably didn't explain it right, I did not mean that the lambda is making a connection instead as you say Greengrass v1 is making a second connection when the lambda is running. Greengrass v1 is certainly NOT making the '-c00' connection when the lambda is NOT running and I know that for sure because we've built an entire notification mechanism based on this fact.
The idea of checking the deployment status is useful to us only if we can create a dynamic thing group to include / exclude devices based on whether the deployment status is success. Do you think that's possible? The reason for using a dynamic thing group is that our device fleet is quite large and instead of querying for the status of each device we would like to always have an up to date list of the devices that have deployed successfully.
Yes, I understand what you mean. The c00 connection will be made even if your lambda is not working. That connection is made for the data connection used by any lambdas or shadows that you have configured. It is not specific to a single lambda function and it cannot tell you if a deployment is successful or not. Greengrass V1 offers APIs to get the deployment status which will tell you if a deployment is successful.
I would not recommend using dynamic groups based on deployment success. Greengrass V2 does let you setup AWS EventBridge rules to be notified when deployments are successful or failed and then execute any logic you may want: https://docs.aws.amazon.com/greengrass/v2/developerguide/deployment-health-notifications.html#deployment.events-message-format.
Thank you for suggesting EventBridge, I'll have a go with that.