- version: 3.0
- Last update: March 2024
- Environment: Windows
- Prerequisite: Prerequisite
LSEG Real-Time SDK (Java Edition) (RTSDK, formerly known as Elektron SDK) is a suite of modern and open source APIs that aim to simplify development through a strong focus on ease of use and standardized access to a broad set of Refinitiv proprietary content and services 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 SDK has been released on the Maven Central Repository to support the modern Java development life cycle since the RTSDK Java (formerly known as Elektron SDK) version 1.2. The Maven Central Repository supported also lets SDK compatibilities with the Java build automation tools like Gradle and Apache Maven. This helps Java developers to build RTSDK Java applications, manage its dependencies (Java Developers do not need to manually manage different versions of jar files anymore), and better collaboration in the team.
The RTSDK Java package comes with the Gradle build tool supported by default. Some developers who are using Maven might feel difficult to try the SDK example codes in their Maven development workflow.
To make Maven developers life easier, I am creating simple tool for generating RTSDK Java Examples Maven's pom.xml file to run the RTSDK Java example source code. The tool supports RTSDK Java since the rebranding version 2.0.0.L1 (EMA/ETA 3.6.0), and you can customize the configuration file to make it supports the future versions of the SDK.
The generated pom.xml file is for running EMA or ETA APIs examples only. The file is not optimized and not recommended for the Production use!. I am not provide any supports for this simple tool.
All scripts require Ruby compiler or Docker Desktop application to run.
The application logic of this tool is simple enough that you can re-create in other programming language. I am choosing Ruby because its simplicity.
The pom.xml
file the main Maven's project configuration. This XML file contains the information required to build a project.
The EMA API Java edition has two type of example applications as follows:
- console example applications in the training folder (for Consumer, Interactive Provider, and Non-Interactive Provider applications)
- GUI consumer example application in the rrtmdviewer* folder.
The GUI example needs JavaFX dependency, so the pom.xml file need JavaFX dependency information too.
You can specify the following EMA Java API and JavaFX dependencies in the Maven pom.xml file for running the EMA Java example applications.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
...
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<rtsdk.version>3.7.2.0</rtsdk.version>
<javafx.version>15.0.1</javafx.version>
</properties>
<dependencies>
<!-- RTSDK -->
<!-- For EMA Java Project -->
<dependency>
<groupId>com.refinitiv.ema</groupId>
<artifactId>ema</artifactId>
<version>${rtsdk.version}</version>
</dependency>
</dependencies>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
<version>${javafx.version}</version>
</dependency>
</project>
The pom.xml file for the ETA Java application is the following. The Maven can automatic pull ETA, ETA ValueAdd and ETA JSON Converter artifacts within Maven central for the application with the com.refinitiv.eta.valueadd.cache
dependency declaration.
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
...
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
<rtsdk.version>3.7.2.0</rtsdk.version>
</properties>
<!-- RTSDK -->
<!-- For ETA Java Project -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.9.5</version>
</dependency>
<dependency>
<groupId>com.refinitiv.eta.valueadd.cache</groupId>
<artifactId>etaValueAddCache</artifactId>
<version>${rtsdk.version}</version>
</dependency>
<dependency>
<groupId>com.refinitiv.eta.ansi</groupId>
<artifactId>ansipage</artifactId>
<version>${rtsdk.version}</version>
</dependency>
</project>
The RTSDK Java version detail is available in the config/rtsdk_versions.yaml
file in the YAML format as follows:
--- # RTSDK Version Mapping
rtsdk_versions:
2.1.0: '3.7.0.0'
2.1.1: '3.7.1.0'
2.1.2: '3.7.2.0'
2.1.3: '3.7.3.0'
latest_version: '2.1.3'
You can add more versions by add the RTSDK Java version as a Key (2.2.0
, 2.2.1
, and so on), then add the EMA/ETA Java Maven Central version as a string value. The EMA/ETA Java Maven Central version number is available on the # Maven Central section of the RTSDK Java's README file and the Maven Central website.
Update Nov 2022:
- For RTSDK version 2.0.7.L2, please specify the RTSDK version as 3.6.7.3 in the pom.xml file.
Example with dummy versions:
--- # RTSDK Version Mapping
rtsdk_versions:
2.0.7: '3.6.7.3'
2.0.8: '3.6.8.0'
3.0.1: '4.7.1.0'
latest_version: '3.0.1'
- Open a project folder in command prompt and run the following command
$> bundle install
- Run the maven_pom_generator.rb script with the following command line argument:
$>ruby maven_pom_generator.rb --api <EMA (default)/ETA> --version <RTSDK version, ex 2.0.8>
- The result
pom.xml
file will be generated in theoutput_pom
folder.
Example result:
$>ruby maven_pom_generator.rb --API EMA --version 2.0.8
EMA
3.6.8.0
use JDK 11
Done creating pom.xml
-
Open a
compose.yaml
file and edit the following content to match your requirementsversion: "3" name: maven_pom_generator services: app: build: context: . volumes: - "<Your Host OS full Path>\\output_pom:/App/output_pom" command: - --API=EMA #- --version=2.1.3 #- --API=ETA #- --version=<RTSDK Java version>
Note: For the Windows OS, the host volume must be full path like
"C:\\Users\\<user>\\output_pom:/App/output_pom"
-
Start a container with the following command
$> docker compose up
-
The result
pom.xml
file will be generated in theoutput_pom
folder. -
To remove a container, use
docker compose down
command. -
To remove an image, use
docker rmi maven_pom_generator-app
command.
Example result:
C:\drive_d\Project\Code\EMA_Ruby_Maven_Generator>docker compose up
[+] Running 1/0
✔ Container maven_pom_generator-app-1 Created 0.0s
Attaching to app-1
app-1 | EMA
app-1 | 3.7.3.0
app-1 | use JDK 11
app-1 | Done creating pom.xml
app-1 exited with code 0
- Refinitiv Real-Time SDK Java page on the Refinitiv Developer Community website.
- Refinitiv Real-Time SDK Family page.
- Apache Maven Project page
- Maven Getting Started Guide
- Maven in 5 Minutes
- Maven Central Repository Search
- Developer Article: How to Set Up Refinitiv Real-Time SDK Java Application with Maven.
- Developer Article: How to deploy and run Real-Time Java Application with Maven in Docker.
- How to Set Up Real-Time SDK Java Application with Maven on the Eclipse IDE on the the LSEG Developer Community web site.