Building Enterprise Message API Java Application with Gradle in a Simple Way

Jonathan Legrand
LSEG Developer Community
3 min readMay 31, 2023

Find the full article, including code snippets, on the LSEG Developer Forum.

The article discusses the Refinitiv Real-Time SDK (Java Edition), previously known as Elektron SDK. It is a suite of APIs that aims to simplify development for computer coders by providing standardized access to Refinitiv’s proprietary content and services. The SDK supports a wide range of capabilities, from low latency/high-performance APIs to simple streaming Web APIs.

The RTSDK Java package has been released on the Maven Central Repository, making it compatible with modern Java development practices. This allows Java developers to easily build applications, manage dependencies, and collaborate effectively within their teams.

Next, I explain the concept of Gradle, a multi-language open-source build automation tool. Gradle helps developers and teams organize project structures, manage dependencies, and automate various development tasks such as running applications, packaging, publishing, and testing. Gradle is the official build tool for the Android development platform.

I also attempt to highlight the need for build automation tools in Java development teams. Modern Java build automation tools simplify the software build and project management processes by automating tasks like compiling, managing dependencies, packaging, and running tests. Without automation, developers would need to manually manage numerous jar files, making project setup and collaboration more challenging. Build automation tools to streamline this process by managing dependencies and providing a clear project folder structure.

The article demonstrates how Gradle simplifies project management by using a simple configuration setting. Developers can define project dependencies and compile, run, and test applications with a single command. This eliminates the need for manual jar file management and enhances collaboration among team members.

Next, I provide prerequisites for working with Gradle, including the Java SDK, Gradle installation, and the Gradle Wrapper. It also mentions the need for access to Refinitiv Real-Time Optimized (RTO) and Refinitiv Real-Time Distribution System (RTDS) for specific examples.

Next, the article explains the project structure recommended for Gradle projects, which consists of a root project and one or more subprojects. It provides a folder structure diagram and explains the purpose of each folder. The project structure is similar to Maven’s project layout.

In summary, the article introduces the Refinitiv Real-Time SDK (Java Edition) and discusses how to use Gradle as a build automation tool in Java development. It highlights the benefits of using Gradle, simplifying project management, and improving collaboration. The article also provides a clear project structure and prerequisites for working with Gradle.

Gradle build file setting for EMA Java

You can specify the following EMA Java application dependencies in Gradle `build.gradle file`. The EMA Java is the message-level API built on top of the ETA Java (Transport API), Gradle can automatically pull all dependency artifacts within Maven central for the application.

plugins {
id ‘java’
id ‘application’
}

repositories {
mavenCentral()
}

dependencies {
// This dependency is used by the application.
implementation ‘com.refinitiv.ema:ema:3.7.0.0’
}

The repositories function specifies where to look for the module that we declare as dependencies. The dependencies function specifies the libraries’ IDs and the implementation property means the project uses EMA for both compilation and runtime.

References

For further references, please check out the following resources:

--

--