How-To Guides
Integration Guides

Set Up Edge Cascading with the NATS Connector

13min
review the following guide for setting up edge cascading, which is an integration of multiple manufacturing connect edge instances with a nats connector before you begin ensure that every manufacturing connect edge instance that will be used to set up the nats proxy connection is on version 3 3 1 or newer determine which manufacturing connect edge instance(s) will be the nats server (host the api access account), and which manufacturing connect edge instance(s) will be the nats client (host the nats connector) the nats server and the nats client can both send and receive the data going through the nats proxy connection if your network has a firewall, make sure it allows port 4222 use case set up edge cascading with one nats client and one nats server review the following use case to set up two manufacturing connect edge instances with edge cascading manufacturing connect edge a (server) is the nats server and manufacturing connect edge b (client) is the nats client you will be able to view data from the nats server step 1 enable nats proxy (nats server) you will need to enable the nats proxy connection in manufacturing connect edge a (server) the connection is disabled by default to enable nats proxy in manufacturing connect edge a (server), navigate to system > tokens in the nats proxy section, click the disabled toggle to enabled step 2 create and configure access account (nats server) you will now need to enable a nats server to do this, you will need to create an access account once you create the account, copy the api key that you will use to set up the nats integration connector to create the access account from manufacturing connect edge a (server), navigate to system > tokens from the access accounts section, click the add icon the create api account dialog box appears enter a name for the account and ensure the enable account checkbox is selected click create account click the action menu for the account you just created and select edit topics in the read topics field, enter the relevant nats topics and click add read topic for each one ensure that you follow proper nats topics conventions for topic names by default, a wildcard topic is created ( > ) this topic will read all topics in the write topics field, enter the relevant nats topics and click add write topic for each one ensure that you follow proper nats topics conventions for topic names to create a wildcard topic, enter > for the topic name when done entering read and write topics, click update click the action menu again for the account and select view api key click the copy icon for the api key and paste it somewhere so you can access it later step 3 create nats integration connector (nats client) you will now have to set up the nats client by creating a nats integration connector to create the nats integration connector from manufacturing connect edge b (client), navigate to integration click the add a connector icon the add a connector dialog box appears use the provider drop down list to select the nats connector enter the details for the connector name enter a name for the connector hostname copy the url of the manufacturing connect edge instance with the nats server and the access account you previously created for example, if the url of the instance with the nats server is https //192 168 0 175, enter 192 168 0 175 port verify the default port is correct and make any necessary changes nats username you can leave the field blank nats password this field is required paste the api key you copied from the access account you previously created default topic name enter a default topic name the default topic name does not need to have data and does not need to present in all systems sending/receiving data it can also be overwritten it will be used later to view the data from the nats connection enable tls secure connection make sure the check box is selected this allows the connector to successfully connect with the nats server insecure skip verify make sure the check box is selected this allows for a successful connection with a nats server that may have a self signed certificate that is not formally recognized by a certificate authority throttling limit you have an option to enter a throttling limit persistent storage you have the option of selecting this option 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 click add step 4 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 5 add device now that you've set up the connection between the nats server and nats client, you can create the devicehub device that will store the tags that will be used to create topics for the nats connector from manufacturing connect edge b (client), follow the steps to connect a device docid\ nm1lqfefya dsiffitity make the following configurations select device type simulator and driver name generator you have the option of setting up a different device to your specific requirements step 6 add tags after connecting the device, you can add tags docid\ h5heqicxrcy3nch9kbg9i to the device the tags will be used to create topics in the nats connector step 7 create topics for connector you will need to create topics in the nats connector you created to create connector topics from manufacturing connect edge b (client), navigate to integration click the nats connector tile the connector dashboard displays click the topics tab click the import from devicehub tags icon the devicehub import dialog box appears select the check box to import all tags from the device you created earlier and click import click the enable all topics icon return to the integration pane and toggle the connect option to enable the connection between the connector and the nats server if the tile status shows connected, the connection was successfully set up step 8 view data once the connection is successfully set up, you can use the flows manager docid\ q4jyt 6f9weaqu53lw3b or analytics docid\ dxce9032oqiligimolvlm in the nats server to view data from the connection before you begin you will need to use the default topic name you configured for the nats connector in the nats client click the edit icon for the nats connector tile and copy the default topic name view data in flows manager you can create a flow to view data from the connector topics to view data from the flows manager from manufacturing connect edge a (server), navigate to flows manager navigate to the flows manager and create a new flow see create a flow docid\ veeod3n3slcasdleedzbr to learn more on the flow canvas, drag the datahub subscribe node and debug node onto the canvas then, connect the two nodes double click the datahub subscribe node the edit datahub subscribe node dialog box appears in the topic field, paste the default topic name for the nats connector if needed, configure the datahub subscribe connection see the step 3 configure connector nodes section in create a flow docid\ veeod3n3slcasdleedzbr to learn more click done , and then click deploy expand the message window beneath the flow to view debug messages click the debug icon confirm the debug node is activated and review the messages in the debug window the "success" \ true message confirms the connection is successful view data in analytics you can view data by using the analytics canvas to view data in analytics from manufacturing connect edge a (server), navigate to analytics click add processor and select datahub subscribe in the topic field, paste the default topic name for the nats connector click save click the view icon review the instance messages the "success" \ true message confirms the connection is successful