How-To Guides
Integration Guides
Generic MQTT Integration Guide (HiveMQ)
8min
review the following guide for setting up an integration between manufacturing connect edge and an mqtt broker using hivemq hivemq's mqtt broker is designed for cloud native deployments to make optimal use of cloud resources the use of mqtt reduces network bandwidth required for moving data before you begin you must download mqtt explorer visit the mqtt dashboard to find the settings required in the mqtt explorer application step 1 connect mqtt explorer to connect mqtt explorer open mqtt explorer click the add icon to create a new connection in the name field, enter a name for the connection in the host field, enter broker hivemq com in the port field, verify that 1883 is entered click connect step 2 add generic mqtt connector follow the steps to add a connector docid\ m2nifnaadyphcvzwmcoto and select the mqtt generic provider configure the following parameters name a recognizable name to identify the connector hostname enter broker hivemq com port confirm that the default value 1883 is entered client id enter 1 username leave this field blank password leave this field blank qos select 0 parallel publish count enter 100 the number of messages being published simultaneously once the defined limit has been reached, subsequent messages are silently dropped integration topic enter mqtt topic lwt topic the topic for mqtt's last will and testament feature you can leave this value blank lwt payload the payload for mqtt's last will and testament feature you can leave this value blank lwt payload type the payload type for mqtt's last will and testament feature the options are string and base64 lwt qos the quality of service value for mqtt's last will and testament feature the default value is 1 lwt retained select this check box to retain the value for mqtt's last will and testament feature throttling limit the maximum number of messages per second to be processed the default value is zero, which means that there is no limit persistent storage when enabled, this will cause messages to undergo a store and forward procedure messages will be stored within manufacturing connect edge when cloud providers are online queue mode select the queue mode as lifo (last in first out) or fifo (first in first out) selecting lifo means that the last data entry is processed first, and selecting fifo means the first data entry is processed first step 3 enable the connector after adding the connector, click the toggle in the connector tile to enable it if you see a failed status, you can review the manage connectors docid\ zz28hztqbk7od xsj81o8 and relevant error messages step 4 create topics for connector to add the outbound and inbound topics to the mqtt connector navigate to integration click the mqtt generic connector tile click the topics tab click the add a new subscription icon the data integration dialog box appears configure the following parameters data direction select local to remote outbound local data topic enter a local data topic name remote data topic confirm the topic where the data is pushed this is the integration topic value for the connector enable select the toggle to enable the topic click ok to add the topic click the add a new subscription icon again to add the inbound topic configure the following parameters data direction select remote to local inbound local data topic enter a local data topic name for example local topic remote data topic confirm the topic where the data is pushed this is the integration topic value for the connector enable select the toggle to enable the topic click ok to add the topic step 5 verify connection in mqtt explorer you can verify the connection in mqtt explorer by subscribing to the topics for the connector step 5a add topic to mqtt explorer you will need to add the topic name you configured for the connector in mqtt explorer to add the topic to mqtt explorer open mqtt explorer click disconnect select the connection you created earlier click advanced in the topic field, enter the integration topic value you configured in step 2 in this use case, the value is mqtt topic verify the qos value is 0 click +add click back click save , and then connect step 5b test connection in flows manager you can test the connection by sending a message through the flows manager to test the connection in flows manager in manufacturing connect edge, navigate to flows manager click the go to flow definition icon for a selected flows manager the flow canvas opens in a new browser tab from the flow canvas, drag the datahub publish node (dataconnector section) and inject node (common section) to the canvas connect the two nodes double click the datahub publish node the edit datahub publish node dialog box appears in the topic field, enter the topic name you configured for the outbound topic you created for the connector if needed, configure the datahub publish connection see create a flow docid 7x0n7c4dxswtd61vpibza to learn more click done double click the inject node the edit inject node dialog box appears in the msg payload field, select string and enter test mqtt connection in the msg topic field, enter the topic name you configured for the outbound topic you created for the connector click done , and then deploy click the inject node button to send the "test mqtt connection" message to the topic verify that the message displays in mqtt explorer