- version: 1.0.2
- Last Update: October 2024
- Environment: Ubuntu or Windows
- Compiler: .NET 6.0
- Prerequisite: prerequisite
Example Code Disclaimer: ALL EXAMPLE CODE IS PROVIDED ON AN “AS IS” AND “AS AVAILABLE” BASIS FOR ILLUSTRATIVE PURPOSES ONLY. REFINITIV MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, AS TO THE OPERATION OF THE EXAMPLE CODE, OR THE INFORMATION, CONTENT, OR MATERIALS USED IN CONNECTION WITH THE EXAMPLE CODE. YOU EXPRESSLY AGREE THAT YOUR USE OF THE EXAMPLE CODE IS AT YOUR SOLE RISK.
Real-Time SDK (C# Edition) (RTSDK, formerly known as Elektron SDK) is a suite of modern and open source APIs (GitHub) that aim to simplify development through a strong focus on ease of use and standardized access to LSEG Real-Time Platform via the proprietary TCP connection named RSSL and proprietary binary message encoding format named OMM Message. The capabilities range from low latency/high-performance APIs right through to simple streaming Web APIs.
The RTSDK C# Edition can run on Windows, Oracle Linux Server, Red Hat Enterprise Server and Ubuntu Linux platforms. It supports the Visual Studio 2022 IDE for the full features development experience but the IDE is available for Windows developers only. Fortunately, the RTSDK C# Edition also supports the cross-platform .NET CORE and the Visual Studio Code (aka VS Code) editor is available for all major OS platforms. Linux and Windows developers who are using the VS Code editor can implement the real-time streaming application with LSEG Real-Time platform using the RTSDK C# Edition.
This example project shows a step-by-step guide to create the EMA API .NET project and solution with the RTSDK C# Edition connect to the Real-Time Optimized (RTO) server on VS Code and the C# extension. I am demonstrating with the RTSDK C# version 2.1.3.L1 on Ubuntu Linux, and this step-by-step guide can be applied to any supported OS platforms.
Note: For developers who connect to the Real-Time Distribution System (RTDS), you can apply the steps to set up the project, solution and the libraries. However, please check the 100_MP_Streaming example and Cons100 section on the RTSDK C# QuickStart page for the source code part.
Before I am going further, there is some prerequisite, dependencies, and libraries that the project is needed.
Firstly, you need .NET 6 SDK for this project. You can download the SDK based on your system from Microsoft .NET 6 website.
Please check How to check that .NET is already installed to verify installed .NET versions on your machine.
Note: Please check the RTSDK C# versions and .NET versions supported from the API Compatibility Matrix document.
Next, the VS Code editor tool with the free C# extension.
Note:
- There is also the C# Dev Kit extension that gives developers more "Visual Studio like" experience and features than the C# extension. However, the C# Dev Kit extension requires Visual Studio License.
- The C# extension requires .NET 8.0 (As of April 2024), but you can setup and compile .NET 6.0 project with the .NET 8.0 SDK.
This project uses RTO access credentials for Version 2 Authentication (Service ID).
Please contact your LSEG representative to help you with the RTO account and services.
Note: For developers who connect to the Real-Time Distribution System (RTDS), you need the following information:
- Your ADS Server or Interactive-Provider application hostname or IP Address
- Your ADS Server or Interactive-Provider application RSSL Port number (14002 by default)
- Your Market Data Service Name
- Your Data Access Control System (DACS) User name
The RTSDK C# libraries (both ETA and EMA APIs) are available on the NuGet package manager and distribution platform. You can use the built-in VS Code CLI command to download the EMA and ETA libraries from NuGet over internet.
That covers the prerequisite of this project.
Please see the Article document for more detail.
The first step is to unzip or download the example project folder into a directory of your choice, then set up Python or Postman environments based on your preference.
-
Open a terminal and go to the project'
ema_project
folder. -
Create a file name
.env
in theema_project
folder with the following content.CLIENT_ID=<Your Auth V2 Client-ID> CLIENT_SECRET=<Your Auth V2 Client-Secret>
-
Run the following command inside the
ema_project
folder to build the project.$>dotnet build
-
Run the following command inside the
ema_project
folder to run the project.$>dotnet run
-
Run the following command inside the
ema_project
folder to publish the project.$>dotnet publish --configuration Release --runtime <.NET runtime identifier> --self-contained
For more detail about the .NET runtime identifier, please check this document.
-
Open a terminal and go to the project'
ema_solution
folder. -
Create a file name
.env
in theema_solution\EMAConsumer
folder with the following content.CLIENT_ID=<Your Auth V2 Client-ID> CLIENT_SECRET=<Your Auth V2 Client-Secret>
-
Run the following command inside the
ema_solution
folder to build the solution.$>dotnet build
-
Run the following command inside the
ema_solution\EMAConsumer
folder to run the EMAConsumer project.$>dotnet run
-
Run the following command inside the
ema_solution
folder to publish the project.$>dotnet publish --configuration Release --runtime <.NET runtime identifier> --self-contained
For more detail about the .NET runtime identifier, please check this document.
Before I finish, let me just say the RTSDK C# give developers access to the LSEG Real-Time platform's real-time streaming data with both low-level and high-levels APIs interfaces for every developers' requirements. For ultra-high performance applications, there is the ETA API that provides high performance, low latency, and open source low-level API interfaces for developers. For the majority of use cases, there is the ease-of-use EMA API with high-level API interfaces for developers. The C# edition SDK supports the cross-platform .NET SDK 6 (aka .NET Core 6) which makes the application can be developed on various types of development environments such as the full-feature Visual Studio 2022 IDE on Windows, or the .NET CLI tool with any editors on the supported platforms.
Visual Studio Code (or just VSCode) is a free, cross-platform source code editor that took over developers' popularity based on its fast and lightweight, supports a variety of programming languages with IntelliSense, and has complete development operations like debugging, task running, and version control. With the the free C# extension, the VS Code can do basic development tasks with .NET development including the RTSDK C# APIs using the editor with the .NET CLI tool. The combination of the VS Code C# extension and .NET CLI tool make they suitable for developing the real-time applications on non-Windows platforms, or even on Windows for developers who do not have the Visual Studio Professional/Enterprise subscriptions.
If you want more powerful development feature on VS Code for the RTSDK C# edition, there is the C# Dev kit extension that gives you the development experience much closer to the full feature Visual Studio IDE while maintain its lightweight and supports all major OS platforms. However, the C# Dev kit extension requires the Visual Studio Professional or Enterprise subscriptions license.
That’s all I have to say about the RTSDK C# development with VS Code.
For further details, please check out the following resources:
- Real-Time SDK C# page on the LSEG Developer Community website.
- Real-Time SDK Family page.
- Real-Time SDK C# Quick Start.
- Developer Article: 10 important things you need to know before you write an Enterprise Real Time application.
- Changes to Customer Access and Identity Management: Refinitiv Real-Time - Optimized.
- EMA C# API Library on NuGet platform.
- .NET SDK page.
- Tutorial: Create a .NET console application using Visual Studio Code.
- Tutorial: Create a .NET class library using Visual Studio Code.
- Setting up VS Code for .NET development page.
- Getting Started with C# in VS Code document.
- How YOU can get started with .NET Core and C# in VS Code blog post.
- Tutorial: Containerize a .NET app.
- .NET SDK on DockerHub platform.
- .NET Runtime on DockerHub platform.
For any question related to this article or the RTSDK page, please use the Developer Community Q&A Forum.