Microsoft SQL Server SSL Integration Guide
Review the following guide for setting up an integration between Litmus Edge and a Microsoft SQL Server database using SSL authentication.
You will need the following:
- Access to a Microsoft SQL Server database that uses SSL authentication.
- The CA Certificate associated with the database.
Refer to the following links to learn more:
Follow the steps to Add a Connector and select the DB - Microsoft SQL Server SSL provider.
Configure the following parameters.
- Name: Enter a name for the connector.
- Hostname: Enter the IP address to access the database.
- Port: The port to access the database. The default value is 1433.
- SSL Mode: Select the SSL mode: disable, true, or false.
- CA Certificate: Paste or upload the CA certificate.
- Username: Enter the username to access the database.
- Password: Enter the password associated with the username.
- Database: Enter the database name.
- Table: Enter the table that will be receiving the data. If you are sending data to an existing table, use the corresponding name.
- Show Mapping: If you want to send data to a custom table, select this check box and unselect Create table. See Work with Tables in SQL Connectors (Create Table and Show Mapping) to learn more. To add key/value pairs for the custom table, see Configure Key/Value Pairs.
- Create table: If you want to send data to an existing table in the default format, or you want to create a new table in the default format, select this check box and unselect Show Mapping. See Work with Tables in SQL Connectors (Create Table and Show Mapping) to learn more.
- Commit timeout: Enter the transaction commit timeout in (ms).
- Max transaction size: Enter the maximum number of messages before a transaction is committed, regardless of timeout parameter.
- Bulk insert count: To enable this option, enter the number of messages to group together and send as one bulk insert statement. Enabling this option can improve how quickly data is processed when dealing with high volumes of tags.
- 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 Litmus 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.
After adding the connector, click the toggle in the connector tile to enable it.
If you see a Failed status, you can review the Connector Logs and relevant error messages.
You will now need to import the tags created in Step 2 as topics for the Microsoft connector. The topics will be created as outbound topics.
After adding all required topics, navigate to the Integration overview page and ensure the connector is not disabled and still shows a CONNECTED status.
To enable the topics, return to the Topics tab and click the Enable all topics icon.
You can now create a flow in Litmus Edge to verify the connection.
To create the flow:
- In Litmus 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 node palette, drag the DataHub Subscribe node (DataConnector section) to the canvas.
- Drag the Debug node to the canvas and connect the two nodes.
- Double click the DataHub Subscribe node. The Edit DataHub Subscribe Node dialog box appears.
- In the Topic field, paste the topic name copied in Step 5.
- Enter tag imported to mssql db in the Name field.
- If needed, configure the Datahub Subscribe connection. See the Step 3: Configure Connector Nodes section in Create a Flow to learn more.
- Click Done.
- Click Deploy.
Expand the message window beneath the flow and click the Debug icon. Verify that messages are displaying.
You can now verify that you can view data in the Microsoft SQL (MSSQL) database.
Update credentials, the database name, and the table as needed for your specific configurations
To make Microsoft SQL queries:
- From the MSSQL terminal window, enter /opt/mssql-tools/bin/sqlcmd -S localhost -U sa -P <sa password> , and then press ENTER.
- Enter select DB_NAME (), and then press ENTER.
- Enter go, and then press ENTER. The master database name appears.
- Enter select name from sys.databases, and then press ENTER.
- Enter go, and then press ENTER. All database names appear.
- Enter use master, and then press ENTER
- Enter go, and then press ENTER. Changed database context to master appears.
- Enter select * from information_schema.tables; and press ENTER.
- Enter go, and then press ENTER. The Table Catalog for the master database appears.
- Enter select * from test_table (or the table name you configured in Step 4), and then press ENTER.
- Enter go, and then press ENTER. If you selected Create table in Step 3, identification messages from the topic appear, including the deviceId and registerId at the end of each message. If you selected Show Mapping in Step 3, the custom mapping you configured appears.