Since your question is more about the cloud lambda side I'm going to reassign this question. What rules do you have setup to trigger your cloud Lambda, Lambda 1? Are you using wildcards?
No, there are no rules triggering Lambda 1, I use StepFunctions to invoke it manually (for now).
Yes, there are wildcard subscriptions involved in this in the following format.
Lambda1 (on Cloud) --> publishes to topic --> CMD/are_you_alive/<lambda's context.aws_request_id>
Lambda1 (on Cloud) --> starts to subscribe to --> RESULT/are_you_alive/<lambda's context.aws_request_id>
Lambda2 (on GG Core device) --> with a GG subscription to topic --> CMD/are_you_alive/+
Lambda2 (on GG Core device) --> publishes its response to --> RESULT/are_you_alive/<whatever aws_request_id it received from Lambda1 as a part of request body>
I repeat my problem, if it helps with clarity:
I'm getting responses from Lambda2 despite the GG Core device is down!!!!!!??
On a side note, is there a recommended way to publish/subscribe to IoT cloud messages from Lambda1 (running on Cloud). PS: I got inspiration from PubSub example from AWS GitHub (AWSIoTPythonSDK).
Appreciate your help!
I found the solution to my problem.
It is not an issue with Lambda or GreenGrass as I doubted earlier.
I have a global scoped variable declared in my Lambdas, so, when AWS is reusing Lambda runtime(s) between invocations, I'm getting unwanted results in its response.
Just wanted to put an end to this thread as closure :)
Error when deploying to GG core in dockerAccepted Answer
Deployment-time variable substitution for subscription topic names?asked 2 years ago
How do you use the local shadow service from a connected device in GG v2?asked a year ago
How to : Multiple core devices and subscriptions across all core devicesasked 4 years ago
How to trigger Lambdas from outside the GG environment, for testing purposeAccepted Answerasked 2 years ago
Proper way to interact with resources/services outside of GG v2asked 2 years ago
GG Core IP Change cuts connexion to Cloudasked 3 years ago
Greengrass IPC to IoT Core in low/no connectivity regionsasked 7 months ago
Ghost Lambdas responding to IoT Cloud subscriptionsasked 3 years ago
Trigger cloud lambda with MQTT message