Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement fallout strategy failed individual message #59

Conversation

osmanhadzic
Copy link
Collaborator

Astarte Device SDK does not currently implement a fallout strategy for individual datastream messages.

In the 'Class AstarteMqttV1Transport,' the method 'SendIndividualValue' handles the 'MqttCommunicationException' by calling the method 'HandleDatastreamFailedPublish' for the stored message.

When the device loses connection with Astarte, failed individual datastream messages will be stored. The method of storage can be determined from a mapping of the interface field 'Retention.' Retention types include 'volatile,' which is stored in cache memory, and 'stored,' which is saved in the local database. The default retention value is 'discarded,' and the 'discard' message retention type does not save.

Testing:

  1. Set up the device to send individual datastream messages with the interface mapping set to 'volatile' or 'stored.'
  2. Turn off the network on the device.
  3. Wait until the device loses connection to Astarte.
  4. Turn on the network on the device.

Finally, failed messages will be sent to Astarte.

@harlem88 harlem88 requested a review from nedimtokic January 31, 2024 16:05
Copy link
Collaborator

@nedimtokic nedimtokic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on debug mode, stored data can be found in SQLite database. After reconnect data are sent to the Astarte.

@harlem88
Copy link
Collaborator

harlem88 commented Feb 1, 2024

Add changes to the Changelog

Develop a fallout strategy for individual datastream messages with
datastream interface mapping. Retention types include 'volatile,' stored
in cache memory, and 'stored,' in the local database. The default
retention value is 'discarded,' and the 'discard' message retention
type does not save.

Signed-off-by: Osman Hadzic <osman.hadzic@secomind.com>
@osmanhadzic osmanhadzic force-pushed the astarte-stored-individual-message branch from c54c910 to 7fbb534 Compare February 3, 2024 10:52
CHANGELOG.md Outdated Show resolved Hide resolved
@osmanhadzic osmanhadzic force-pushed the astarte-stored-individual-message branch from 7fbb534 to ba2fd74 Compare February 5, 2024 10:36
@osmanhadzic osmanhadzic requested a review from harlem88 February 5, 2024 10:37
CHANGELOG.md Outdated Show resolved Hide resolved
Signed-off-by: Osman Hadzic <osman.hadzic@secomind.com>
@osmanhadzic osmanhadzic force-pushed the astarte-stored-individual-message branch from ba2fd74 to 482d53e Compare February 5, 2024 12:25
@harlem88 harlem88 merged commit 396d7a0 into astarte-platform:master Feb 5, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants