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

feat: add BIRTH message caching on already connected connections for CloudConnectionManager implementations #4817

Merged

Conversation

marcellorinaldo
Copy link
Contributor

@marcellorinaldo marcellorinaldo commented Aug 24, 2023

This PR caches the BIRTH and APP messages for 30 seconds before sending, resetting the timer when new BIRTH messages arrive. On new connections or on disconnect, the BIRTH messages are always sent immediately.

APP messages are guaranteed to be always sent only if the CC is connected; this means after the first connection BIRTH.

It is sufficient to send only the last APP/BIRTH message; the payload is not incremental and contains all the metrics available at that moment (hence the last message contains the most updated system picture).

The changes are made for core.cloud and reflected into the cloudconnection.eclipseiot.mqtt.cloud package.

@MMaiero MMaiero requested a review from nicolatimeus August 25, 2023 08:46
@marcellorinaldo marcellorinaldo changed the title feat(core.cloud): add BIRTH message caching on already connected connections feat: add BIRTH message caching on already connected connections for CloudConnectionManager implementations Aug 28, 2023
@marcellorinaldo marcellorinaldo marked this pull request as ready for review August 30, 2023 07:55
@nicolatimeus nicolatimeus merged commit b02a4f6 into eclipse-kura:develop Sep 4, 2023
@nicolatimeus nicolatimeus deleted the birth-message-caching branch September 4, 2023 09:47
pierantoniomerlino pushed a commit that referenced this pull request Sep 26, 2023
…CloudConnectionManager implementations (#4817)

* feat: add birth delay if already connected, refacored code to use new LifecycleMessage type

Signed-off-by: Marcello Martina <[email protected]>

* feat: APP certificates are always delayed and are kept in a separate buffer

Signed-off-by: Marcello Martina <[email protected]>

* refactor: added debug log messages

Signed-off-by: Marcello Martina <[email protected]>

* test: increased timeout to account for cache delay

Signed-off-by: Marcello Martina <[email protected]>

* chore: updated copyright header

Signed-off-by: Marcello Martina <[email protected]>

* refactor; publishAppCertificate does not throw any exception

Signed-off-by: Marcello Martina <[email protected]>

* feat(cloudconnection.eclipseiot.mqtt.provider): added birth message caching

Signed-off-by: Marcello Martina <[email protected]>

* test: add birth message caching tests

Signed-off-by: Marcello Martina <[email protected]>

* test: added missing test annotations

Signed-off-by: Marcello Martina <[email protected]>

* refactor: changed variable name to not have the same name as field

Signed-off-by: Marcello Martina <[email protected]>

---------

Signed-off-by: Marcello Martina <[email protected]>
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.

2 participants