The DataHub nodes provided in LoopEdge Flows can be used to publish and subscribe to DataHub topics.
DataHub (Publish) Node
The DataHub input node is used to send data to the local topic. The local topic is defined in the DataHub section. The local topic is connected to the cloud connector on the DataHub page. The user uses the same topic to send data to the local topic. Select the server and enter the topic in order to publish data to the local DataHub.
DataHub (Subscribe) Node
The Datahub output node is used to get data from the local topic. Data being published to the local topic can be subscribed using the Datahub output flow. The legacy devices connected to DeviceHub publish their data to a local topic, which can be published from and subscribed to a cloud connection to send it to the cloud. Select the server and the topic in order to subscribe to the local DataHub.
Example of Publishing Data Using a DataHub Node
Inject the data being calculated to the Datahub Publish node. The data will be sent to the topic defined in DataHub.
Example of Subscribing to a Topic using a DataHub Node
Data coming to the local topic can be subscribed to using the Datahub subscribe topic. DeviceHub sends data to the default topic 'devicehub/#' and it can be collected on the flow using data hub subscribe. Any calculation can be performed on the data received using flows.