Refinitiv Real-Time SDK - C/C++
|Last update||Dec 2020|
|Compilers||Tutorial demonstration: Visual Studio (Windows), GCC (Linux)
Refer to the EMA Compiler Guides for a complete list
|Prerequisites||Set up your build environment as outlined in the RTSDK Build System.
Access to an existing Refinitiv Real-Time Distribution System to retrieve content
The Enterprise Message API (EMA) is an easy to use API for requesting a variety of market data from Refinitiv Real-Time systems. EMA is supported on Windows and Linux platforms. The goal of this quick start is to guide a first-time user through the steps involving downloading, installing, and compiling the first example from this toolkit. You can optionally run compiled binary as well. To run the application you would need details of the market data system, as identified in step "Run the example".
To access the Windows EMA package, navigate to the Refinitiv Real-Time SDK - C/C++ Edition webpage within the Developer Portal.
- Below the summary, select the Downloads tab
- Within the Downloads section, choose a Refinitiv Real-Time SDK for Windows or Linux package
Uncompress the downloaded package in a directory of your choosing.
The software package from Refinitiv gets downloaded as a zip archive. The libraries in the package are all static linked, so no components need to be registered. Just deflate the compressed archive into a directory of your choice and it is done.
The deflated download package contains the CMake, Ema, and Eta directories.
|- Cpp-C |
|- Ema |
The CMake is the cross-platform management system, which is used to generate the project build files, targeting different compilers available on the machine.
The Enterprise Transport API (ETA) is the underlying API that EMA is built upon. The Ema directory contains API documentation, data dictionary definition files, working samples, and the source code for the API itself. The source code for EMA is also hosted at GitHub in Refinitiv Real-Time SDK repository. The user community is invited to contribute and help improve API.
All EMA examples are in Ema/Examples/Training directory. The examples are provided for Consumers and Providers and are organized into different directories in order of increasing complexity. The Readme.txt file in each directory explains what that example is supposed to do. In order to compile the example, the first step is to generate the project build files. It can be a Visual Studio xxx solution files for Windows OS or a makefile for GCC for Linux. The CMake build system will process all the CMake targets, and generate these files.
The following steps need to be taken:
- Install CMake
- Generate the project build files
- Compile the sample
Please refer to RTSDK Build System on how to install and configure CMake, and use it to generate Visual Studio project or Linux makefile.
3. Compile the sample
We will build the simplest consumer example - 100__MarketPrice__Streaming which connects to the data server running on the localhost on RSSL port 14002, and sends a Market Price request for an instrument. The output from this sample is dumped onto standard out on the console.
Following is the path to important directories:
|SDK Source Code||root\Cpp-C\Ema\Examples\Training\Consumer\100_Series\100_MP_Streaming|
|Generated project file||root\SOLUTION_FILES\Cpp-C\Ema\Examples\Training\Consumer\100_Series\100_MP_Streaming|
|Output Binary||root\Cpp-C\Ema\Executables\ *|
To build this sample, navigate to the directory SOLUTION_FILES\Cpp-C\Ema\Examples\Training\Consumer\100_Series\100__MarketPrice__Streaming and open and build the Cons100.vcxproj in Visual Studio 2013. For Linux, run make in this directory.
The compiled output will be root\Cpp-C\Cpp-C\Ema\Executables\ directory.
To properly execute this step, you would need access to Refinitiv Real-Time Distribution System. Your market data administrator can provide details about the server hostname and RSSL port. In addition, you would need to know what is the Service Name provided by the server, and a valid Username entitled to request market data.
Once you have these details, sample application implementation in Consumer. cpp at root\Cpp-C\Ema\Examples\Training\Consumer\100_Series\100_MP_Streaming\Consumer.cpp will have to be modified and rebuilt to reflect this change. Type in the hostname/port and username and service name and recompile as shown in the previous step.
The output from the sample looks like this (requesting IBM.N from my service ELEKTRON_AD):
state="Open / Ok / None / 'All is well'"
permissionData="03 01 01 62 C0"
FieldList FieldListNum="79" DictionaryId="1"
FieldEntry fid="1" name="PROD_PERM" dataType="UInt" value="62"
FieldEntry fid="2" name="RDNDISPLAY" dataType="UInt" value="64"
FieldEntry fid="3" name="DSPLY_NAME" dataType="Rmtes" value="INTL BUS MACHINE"
FieldEntry fid="4" name="RDN_EXCHID" dataType="Enum" value="2"
FieldEntry fid="6" name="TRDPRC_1" dataType="Real" value="142.090000"
FieldEntry fid="22" name="BID" dataType="Real" value="142.130000"
FieldEntry fid="11" name="NETCHNG_1" dataType="Real" value="-0.530000"
FieldEntry fid="12" name="HIGH_1" dataType="Real" value="142.810000"
FieldEntry fid="13" name="LOW_1" dataType="Real" value="141.650000"
FieldEntry fid="14" name="PRCTCK_1" dataType="Enum" value="2"