Forwarding Destinations #406
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the concept of a "forwarding destintation" for devices, which allows us to reroute and transform MQTT forwarded messages for specific downstream research projects.
We can create a new forwarding destination in the console with eg
ForwardingDestination.create(name: "important_eu_research_project")
, this will then be made available, for researcher users, in the "forwarding destination" dropdown on the edit device page.If a user selects a forwarding destination apart from the default on the device edit page, then this will be included as an extra parameter in the
data_policy
section on both the API and in forwarded MQTT packets.This allows us to set up custom forwarding rules in EMQX for these packets.
We can also search for all devices which are forwarding to a given destination in the API:
/v0/devices/?q[forwarding_destination_name_eq]=important_eu_research_project
...and also for all users with at least one device that forwards to that destination:
/v0/users/?q[devices_forwarding_destination_name_eq]=important_eu_research_project