EMA Quick Start
|Last update||May 2018|
|Compilers||Tutorial demonstration: Visual Studio (Windows), gcc (Linux)
Refer to the EMA Compiler Guides for a complete list
|Prerequisites||Setup your build environment as outlined in the ESDK Build System.
Access to an existing TREP or Elektron platform to retrieve content
Eleckron Message API is an easy to use API for requesting variety of market data from Thomson Reuters 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 market data system, as identified in step "Run the example".
To access the Windows EMA package, navigate to the Elektron Message API - C/C++ Edition webpage within the Developer Portal.
- Below the summary, select the Downloads tab
- Within the Downloads section, choose an Elektron - C++ SDK Windows or Linux package for download
Uncompress the downloaded package in a directory of your choosing.
The software package from Thomson Reuters 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 EMA package contains the CMake, Ema and Eta directories.
root |- CMake |- Elektron-SDK-BinaryPack |- Cpp-C |- Eta/... |- Ema |-Docs |-Examples |-Libs |-Src ...
The CMake is the cross platform management system, which is used to generate the project build files, targeting different compilers available on the machine.
ETA is the underlying Elektron Transport API that EMA is built upon. The Elektron-SDK-BinaryPack directory contains libraries which an EMA application has to use. 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 Thomson Reuters repository. 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.
Following steps needs to be taken:
- Install CMake
- Generate the project build files
- Compile the sample
Please refer to ESDK 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 data server running on the localhost on RSSL port 14002, and sends Market Price request for an instrument. The output from this sample is dumped on to standard out on console.
Following is the path to important directories:
|SDK Source Code||root\Cpp-C\Ema\Examples\Training\Consumer\100_Series\100__MarketPrice__Streaming|
|Generated project file||root\SOLUTION_FILES\Cpp-C\Ema\Examples\Training\Consumer\100_Series\100__MarketPrice__Streaming|
|Output Binary||root\Cpp-C\Ema\Executables\ *|
To build this sample, navigate to 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
To properly execute this step, you would need access to Thomson Reuters Market Data system. The market Data endpoint can be an Advanced Distribution Server (ADS), Elektron Zero Daemon or a local provider source. 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__MarketPrice__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 previous step.
The output from the sample looks like this (requesting IBM.N from my service ELEKTRON_AD):
>> Cons100.exe RefreshMsg streamId="5" domain="MarketPrice Domain" Solicited RefreshComplete ClearCache state="Open / Ok / None / 'All is well'" itemGroup="00 02" permissionData="03 01 01 62 C0" qos="RealTime/JustInTimeConflated" seqNum="62064" name="IBM.N" nameType="1" serviceId="257" serviceName="ELEKTRON_AD" Payload dataType="FieldList" 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"