Meshblu will automatically re-emit a message as a new message from the forwarded device. Unlike subscriptions, this allows you to map a message of one type into a new type.
Meshblu currently supports forwarding the following event types:
- broadcast.received
- configure.received
- unregister.received
{
"meshblu": {
"forwarders": {
"broadcast": {
"received": [
{
"type": "meshblu"
}
]
}
}
}
}
This would allow any broadcast received to be re-emitted as a new message from the device.
Forwarded Routes
Each time a message is forwarded the entire route
is appended to the forwardedRoutes
property in chronological order. The first route in the list is the origin of the message. The from in the first route in the list is the originator of the message. This allows you to see the history of how this message was received, including subscriptions.
{
"metadata": {
"forwardedRoutes": [
[
{
"from": "Device A",
"to": "Device A",
"type": "broadcast.sent"
},
{
"from": "Device A",
"to": "Device B",
"type": "broadcast.received"
}
],
[
{
"from": "Device B",
"to": "Device C",
"type": "message.sent"
},
{
"from": "Device C",
"to": "Device C",
"type": "message.received"
}
]
],
"route": [
{
"from": "Device B",
"to": "Device C",
"type": "message.sent"
},
{
"from": "Device C",
"to": "Device C",
"type": "message.received"
}
]
}
}
Circular Forwarders
Meshblu will detect circular forwarders to prevent infinite loops by looking at the
forwardedRoutes
property.