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

Use shared subscriptions where appropriate for HA support #29

Merged
merged 5 commits into from
Jun 7, 2023

Conversation

knolleary
Copy link
Member

Description

Updates the project nodes to use a shared subscription where appropriate to enable HA support.

All subscriptions (except link call response topic) now uses a shared subscription. The group id of the share is set to the project id.

The link call response topic now includes a randomly generated (per-node) string appended to res-. For this to work, that string is also passed in the messageEvent property of the published message. That allows the returning node to reconstruct the appropriate topic to send the reply to.

This all requires a FlowForge platform instance that includes FlowFuse/flowfuse#2225

This feature should be published with a major version bump to ensure existing installs of FF do not pick this change up.

@knolleary knolleary requested a review from Steve-Mcl June 5, 2023 11:54
@knolleary knolleary linked an issue Jun 7, 2023 that may be closed by this pull request
@knolleary
Copy link
Member Author

@Steve-Mcl I've updated the nodes to only use shared subs if the settings file sets a flag called useSharedSubscriptions.

This will mean devices continue to use regular topics as intended.

nodes/project-link.js Outdated Show resolved Hide resolved
Copy link
Contributor

@Steve-Mcl Steve-Mcl left a comment

Choose a reason for hiding this comment

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

Fully tested locally (discussion on slack).

Good to go.

@Steve-Mcl Steve-Mcl merged commit 3ab611f into main Jun 7, 2023
1 check passed
@Steve-Mcl Steve-Mcl deleted the 28-shared-subs branch June 7, 2023 15:03
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.

Add support for Shared Subscriptions when instance in HA mode
2 participants