- Newest
- Most votes
- Most comments
Hi Sash. There is an MQTT spooler. https://docs.aws.amazon.com/greengrass/v2/developerguide/configure-greengrass-core-v2.html#configure-mqtt https://docs.aws.amazon.com/greengrass/v2/developerguide/greengrass-nucleus-component.html
spooler (Optional) The MQTT spooler configuration for the Greengrass core device. This object contains the following information:
maxSizeInBytes (Optional) The maximum size of the cache where the core device stores unprocessed MQTT messages in memory. If the cache is full, the core device discards the oldest messages to add new messages.
Default: 2621440 (2.5 MB)
keepQos0WhenOffline (Optional) You can spool MQTT QoS 0 messages that the core device receives while its offline. If you set this option to true, the core device spools QoS 0 messages that it can't send while it's offline. If you set this option to false, the core device discards these messages. The core device always spools QoS 1 messages unless the spool is full.
Default: false
Wanted to update this answer as there has been a feature release with GG V2 Version 2.11 - https://docs.aws.amazon.com/greengrass/v2/developerguide/disk-spooler-component.html
This disk spooler component , along with Nucleus configurations as specified in the above link will ensure that the MQTT messages are backedup to disk.
This will ensure that data loss is prevented in case of disconnection
Relevant content
- Accepted Answerasked 9 months ago
- Accepted Answerasked a month ago
- Confused about permissions in IOT Core/PubSub/Shadows, Greengrass, IAM roles, service roles and IPC.Accepted Answerasked 2 years ago
- asked 3 years ago
- AWS OFFICIALUpdated 5 months ago
- AWS OFFICIALUpdated 3 years ago
- AWS OFFICIALUpdated 8 months ago
- AWS OFFICIALUpdated a year ago
Thank you Greg - This is great. I haven't configured Nucleus as yet - Nucleus is obviously running, as part of the GG runtime (GG is Nucleus). What is the best way to configure it? Through the deployment of "Public Components -> aws.greengrass.Nucleus", and then configure it that way? and "wrap it up" as part of a targeted deployment for a newly added device within that "Thing Group"?
Additional question:
If GG (Nucleus) is rebooted - or the device is rebooted, do those messages get lost? seems that the spooler caches the messages in-memory - does it offload it onto the disk by any chance? I'm assuming that can be done via Deployments anyway...
There's a few options. Without knowing your use case, I couldn't say what the best way is, but please take a look at custom provisioning: https://docs.aws.amazon.com/greengrass/v2/developerguide/custom-provisioning.html . Yes the spooler is in-memory, so messages would be lost in that scenario. Please add your +1 to this GitHub issue: https://github.com/aws-greengrass/aws-greengrass-nucleus/issues/825