Skip to content

Conversation

@timcowlishaw
Copy link
Contributor

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

@timcowlishaw timcowlishaw requested a review from oscgonfer July 15, 2025 19:06
@timcowlishaw timcowlishaw linked an issue Jul 15, 2025 that may be closed by this pull request
@timcowlishaw timcowlishaw merged commit 96e9efd into master Jul 29, 2025
1 check passed
@timcowlishaw timcowlishaw deleted the forwarding-location-field branch July 29, 2025 05:58
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 way to select where to forward to

2 participants