The optional "forwardToExternalBrokers" property specifies one or more brokers to forward the message to. All messages sent to this topic will be forwarded to each of these external brokers using the specified topic name.
It is an array containing zero or more objects, including some or all of the following properties:
"brokerConnectionName"
"forwardQos"
"topic"
- If there are no items in the list, it is not an error, FairCom's servers simply do not set up any external forwards. This is also how you can configure an existing topic to STOP forwarding to external brokers.
- If this broker connection name does not already exist:
- FairCom's servers do not set up the forward.
- It logs an error stating,
“Cannot forward to the external broker because the connection name xxx has not yet been defined by configureBrokerConnection.” - A failure does not stop FairCom's servers from trying to set up the next broker in the list.
- Each time the
"configureTopic"message is sent, FairCom's servers will completely replace its existing list for"forwardToExternalBrokers"with the new list.- Be careful not to create infinite message loops by forwarding topics to each other. For example, topic A forwards to topic B and topic B forwards to topic A. FairCom's servers currently do not detect or shut down infinite message loops.
Example
{
"api": "mq",
"action": "configureTopic",
"params":
{
"topic": "modbusdata1",
"tableName": "modbusTableTCP",
"forwardToExternalBrokers":
[
{
"brokerConnectionName": "Broker1",
"topic": "modbusdata2",
"forwardQoS": 1
}
]
},
"authToken": "replaceWithAuthTokenFromCreateSession"
}