Crosser + UNS - Persist data from UNS in external database
In some cases, you want to persist data from your UNS in order to be consumed by external applications, store them for further analysis or visualize them in dashboards. To do that, you can simply create batches of data with the ‘Array Join’, either based on the message count or on a specified time interval. Afterwards, simply send the data array to your Insert module (MsSQL in this case) to insert the data from the array with one query instead of line-by-line. This will reduce the load in your database.
Before joining the message, we have moved the property ‘topic’ to ‘data.topic’ so it becomes part of the dataset we insert.
Tip: When you click on the bracket next to ‘data’, the array collapses and you can see the amount of objects within that array.
Assuming you have configured the columns the right way, you should see entries in your database like below.
Keep in mind to configure queues and retries to overcome downtime towards your database. You can also increase the ‘Command Timeout’ as part of your connection string in case your database is busy.
Example: Server=tcp:192.168.0.5;Database=crosser;User ID=demo;Password=crosser123;Encrypt=false;Command Timeout=600;