ValidicInformSDK 0.10.0

A simple SDK to interact with the Validic Streaming Service, parse data, and publish events to a separate data store.

Install-Package ValidicInformSDK -Version 0.10.0
dotnet add package ValidicInformSDK --version 0.10.0
<PackageReference Include="ValidicInformSDK" Version="0.10.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ValidicInformSDK --version 0.10.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

ValidicDotNetSDK

ValidicDotNetSDK is a DotNet library for connecting to the Validic Streaming API, receiving SSE Events,
parsing those events, and staging them for further processing.

Installation

It is recommended to use nuget to install ValidicDotNetSDK.

dotnet add package ValidicInformSDK --version 0.9.0

Usage for implementing Streaming API Client

using Validic.Streams;
using Validic.Publishers;
using Validic.Configuration;

const string STREAM_CONFIG_FILE_PATH = @"./application.json";
Config config = new Config(STREAM_CONFIG_FILE_PATH);
StreamConsumerSet streamConsumers = new StreamConsumerSet(config);

Usage for implementing IPublisher based class

Note: BasePublisher implements IPublisher interface

using Validic.Publishers;
using Validic.Models.Resources;
using Validic.Models.Streams;

class MyPublisher : BasePublisher
    {
        public override void PublishResource(Resource r, StreamConsumerMetaData m)
        {
            Console.WriteLine($"MY RESOURCE[{m.consumerId}|{m.resourceCounter}]: {r.serialize()}");
        }

        public override void PublishPoke(StreamPoke poke, StreamConsumerMetaData metaData)
        {
            Console.Write($"MY POKE:");
            base.PublishPoke(poke, metaData);
        }
    }

Configuration File Example

The following example configuration file is set up to use 5 connections to communicate with the Validic Streaming
API and publishes events to each of the 3 defined publishers. Note that the publisherClassName is the fully
qualified class name, including project name.

{
  "streamId": "0000SAMPLE_STREAM_ID000",
  "token": "0000000000SAMPLE_TOKEN0000000000",
  "connectionCount": 5,
  "dataFlowTimeoutMs": 10000,
  "publishers": [
    {
      "publisherType": "mypublisher",
      "publisherClassName": "Validic.Sample.MyPublisher, Validic.Sample"
    },
    {
      "publisherType": "stdout",
      "publisherClassName": "Validic.Publishers.StandardOutPublisher, Validic.Inform"
    },
    {
      "publisherType": "azure",
      "publisherEnabled": false,
      "publisherClassName": "Validic.Publishers.AzureEventHubPublisher, Validic.Inform",
      "options": [
        {
          "key": "connectionString",
          "value": "Endpoint=sb://<FQDN>/;SharedAccessKeyName=<KeyName>;SharedAccessKey=<KeyValue>"
        },
        {
          "key": "eventHubName",
          "value": "<EventHubName>"
        }
      ]
    },
    {
      "publisherType": "kinesis",
      "publisherEnabled": false,
      "publisherClassName": "Validic.Publishers.KinesisPublisher, Validic.Inform",
      "options": [
        {
          "key": "profileName",
          "value": "<AWSCredentialsProfileName>"
        },
        {
          "key": "region",
          "value": "<RegionEndPointString>"
        },
        {
          "key": "streamName",
          "value": "<KinesisStreamName>"
        }
      ]
    }
  ]
}

License

VALIDIC

ValidicDotNetSDK

ValidicDotNetSDK is a DotNet library for connecting to the Validic Streaming API, receiving SSE Events,
parsing those events, and staging them for further processing.

Installation

It is recommended to use nuget to install ValidicDotNetSDK.

dotnet add package ValidicInformSDK --version 0.9.0

Usage for implementing Streaming API Client

using Validic.Streams;
using Validic.Publishers;
using Validic.Configuration;

const string STREAM_CONFIG_FILE_PATH = @"./application.json";
Config config = new Config(STREAM_CONFIG_FILE_PATH);
StreamConsumerSet streamConsumers = new StreamConsumerSet(config);

Usage for implementing IPublisher based class

Note: BasePublisher implements IPublisher interface

using Validic.Publishers;
using Validic.Models.Resources;
using Validic.Models.Streams;

class MyPublisher : BasePublisher
    {
        public override void PublishResource(Resource r, StreamConsumerMetaData m)
        {
            Console.WriteLine($"MY RESOURCE[{m.consumerId}|{m.resourceCounter}]: {r.serialize()}");
        }

        public override void PublishPoke(StreamPoke poke, StreamConsumerMetaData metaData)
        {
            Console.Write($"MY POKE:");
            base.PublishPoke(poke, metaData);
        }
    }

Configuration File Example

The following example configuration file is set up to use 5 connections to communicate with the Validic Streaming
API and publishes events to each of the 3 defined publishers. Note that the publisherClassName is the fully
qualified class name, including project name.

{
  "streamId": "0000SAMPLE_STREAM_ID000",
  "token": "0000000000SAMPLE_TOKEN0000000000",
  "connectionCount": 5,
  "dataFlowTimeoutMs": 10000,
  "publishers": [
    {
      "publisherType": "mypublisher",
      "publisherClassName": "Validic.Sample.MyPublisher, Validic.Sample"
    },
    {
      "publisherType": "stdout",
      "publisherClassName": "Validic.Publishers.StandardOutPublisher, Validic.Inform"
    },
    {
      "publisherType": "azure",
      "publisherEnabled": false,
      "publisherClassName": "Validic.Publishers.AzureEventHubPublisher, Validic.Inform",
      "options": [
        {
          "key": "connectionString",
          "value": "Endpoint=sb://<FQDN>/;SharedAccessKeyName=<KeyName>;SharedAccessKey=<KeyValue>"
        },
        {
          "key": "eventHubName",
          "value": "<EventHubName>"
        }
      ]
    },
    {
      "publisherType": "kinesis",
      "publisherEnabled": false,
      "publisherClassName": "Validic.Publishers.KinesisPublisher, Validic.Inform",
      "options": [
        {
          "key": "profileName",
          "value": "<AWSCredentialsProfileName>"
        },
        {
          "key": "region",
          "value": "<RegionEndPointString>"
        },
        {
          "key": "streamName",
          "value": "<KinesisStreamName>"
        }
      ]
    }
  ]
}

License

VALIDIC

Release Notes

Added basic AWS Kinesis Producer capabilities

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
0.10.0 88 11/17/2020
0.9.0 103 11/5/2020