Table of Contents
EnOS Data Subscription Service improves the API calling efficiency of applications with active data push, which supports subscription to real-time asset data, offline asset data, and asset alert data.
After configuring and starting data subscription jobs on the EnOS Management Console, you can use the Data Subscription SDK for .NET to develop applications for consuming the subscribed data.
The Data Subscription SDK is for .NET Framework 4.7, and newer versions.
You can install the SDK from Package Manager Console, or build from source.
The latest version of EnOS Data Subscription SDK for .NET is available in the Package Manager Console and can be installed using:
Install-Package enos_subscription -Version 2.4.2
-
Obtain the source code of Data Subscription SDK for .NET.
- From GitHub:
git clone https://github.com/EnvisionIot/enos-subscription-service-sdk-dotnet.git
- From EnOS SDK Center. Click SDK Center from the left navigation of EnOS Console, and obtain the SDK source code by clicking the GitHub icon in the Obtain column.
-
In Visual Studio, add the source code project into your solution and add as reference to your project.
The EnOS Data Subscription SDK for .NET has the following dependency modules:
EnOS Enterprise Data Platform supports subscribing to asset time series data and alert data and pushing the subscribed data to applications, thus improving the data query efficiency of applications.
The features supported by this SDK include:
- Consuming subscribed real-time asset data
- Consuming subscribed alert data
- Consuming subscribed offline asset data
using enos_subscription.client;
using (DataClient client = new DataClient("sub-host", "sub-port", "Your Access Key of this subscription", "Your Access Secret of this subscription")) {
client.subscribe("Your subscription Id", "Your consumer group");
foreach (var message in client.GetMessages())
{
//do something with the message
}
}
using enos_subscription.client;
using (AlertClient client = new AlertClient("sub-host", "sub-port", "Your Access Key of this subscription", "Your Access Secret of this subscription")) {
client.subscribe("Your subscription Id", "Your consumer group");
foreach (var message in client.GetMessages())
{
//do something with the message
}
}
using enos_subscription.client;
using (OfflineClient client = new OfflineClient("sub-host", "sub-port", "Your Access Key of this subscription", "Your Access Secret of this subscription")) {
client.subscribe("Your subscription Id", "Your consumer group");
foreach (var message in client.GetMessages())
{
//do something with the message
}
}
To learn more about the Data Subscription feature of EnOS Enterprise Data Platform, see Data Subscription Overview.
- 2020/04/24 (2.4.1): Initial release