1. Home
  2. API Catalog
  3. Refinitiv Real-Time Java SDK

Refinitiv Real-Time SDK - Java

Quick Start

Last update Dec 2020
Environment Windows, Linux
Compilers JDK 1.7 or greater
Prerequisites Setup your build environment as outlined in the RTSDK Build System.
  Access to an existing Refinitiv Real-Time Distribution System to retrieve content

Introduction

The goal of this Getting Started tutorial is to provide the developer the steps required to execute an Enterprise Message API (EMA) sample application within their environment.  EMA is a sub-component of the RTSDK (Refinitiv Real-Time SDK) package that includes a number of examples available to test specific functionality.  For our purposes, the goal is to walk through the procedure to specify the connection details to access your market data environment to connect and retrieve market data content.

The tutorial will cover both Linux and Windows environments.

Select and configure a consumer sample

Once you've completed the pre-requisite steps to establish your build environment as outlined within the RTSDK Build System guide, navigate to the ex100_MP_Streaming folder within the RTSDK package.  This sample demonstrates the retrieval of market data from Refinitiv Real-Time systems.

To setup this example, you will need to modify the Consumer.java within  ex100_MP_Streaming directory.  Specifically, the following is required:

  • Server connection details
  • Service providing market data

You will need to reach out to your market data team to get this required information.  Within the java source file, navigate to the section that shows the code segment below:

    	
            

...

 

try

{

AppClient appClient = new AppClient();

OmmConsumerConfig config = EmaFactory.createOmmConsumerConfig();

consumer  = EmaFactory.createOmmConsumer(config.host("localhost:14002").username("user"));

ReqMsg reqMsg = EmaFactory.createReqMsg();

consumer.registerClient(reqMsg.serviceName("DIRECT_FEED").name("IBM.N"), appClient);

Thread.sleep(60000); // API calls onRefreshMsg(), onUpdateMsg() and onStatusMsg()

 

...

There are key pieces of data within the above code segment that may need to be modified in order for you to successfully execute the example. Your market data administrator can provide connection details about the server hostname and RSSL port, presently set to localhost:14002.  In addition, you would likely need to set the Service Name, presently set to DIRECT_FEED and a DACS Username required to entitle you to request for market data.

Build and run the example

Use Gradle to build and run this example.  From your <RTSDK root>/Java directory:

    	
            
> Gradlew runconsumer100

Note: The name of the example above was determined by the examples listing demonstrated within the RTSDK Build System guide.

Upon execution, we are presented with some initial connection results followed by our initial image called a RefreshMsg. The RefreshMsg or initial image contains all fields for the requested instrument representing the latest up-to-date market values. Following this image, we will begin to see UpdateMsgs or realtime updates reflecting changes in the market.

The example application will automatically exit after ~1 minute.  Alternatively, you can (Ctrl+C) to exit at any time.

    	
            

>gradlew.bat runconsumer100

 

> Configure project :

RTSDK-BinaryPack already exists, skip downloading.

 

> Task :Ema:Examples:runconsumer100

Dec 17, 2020 1:41:25 PM com.refinitiv.ema.access.ConfigErrorTracker log

SEVERE: loggerMsg

    ClientName: EmaConfig

    Severity: Error

    Text:    Unable to find tagId for DefaultServiceID

loggerMsgEnd

 

 

Dec 17, 2020 1:41:26 PM com.refinitiv.ema.access.ChannelCallbackClient reactorChannelEventCallback

INFO: loggerMsg

    ClientName: ChannelCallbackClient

    Severity: Info

    Text:    Received ChannelUp event on channel Channel_1

        Instance Name Consumer_1_1

        Component Version ads3.0.3.L1.linux.tis.rrg 64-bit

loggerMsgEnd

 

 

RefreshMsg

    streamId="5"

    domain="MarketPrice Domain"

    solicited

    RefreshComplete

    state="Open / Ok / None / 'All is well'"

    itemGroup="00 03"

    permissionData="03 08 43 62 c0"

    name="IBM.N"

    nameType="1"

    serviceId="2115"

    serviceName="RT_FEED"

    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="125.55"

            FieldEntry fid="7" name="TRDPRC_2" dataType="Real" value="125.55"

            FieldEntry fid="8" name="TRDPRC_3" dataType="Real" value="125.55"

            FieldEntry fid="9" name="TRDPRC_4" dataType="Real" value="125.55"

            FieldEntry fid="10" name="TRDPRC_5" dataType="Real" value="125.55"

            FieldEntry fid="11" name="NETCHNG_1" dataType="Real" value="-0.38"

            FieldEntry fid="12" name="HIGH_1" dataType="Real" value="126.55"

            FieldEntry fid="13" name="LOW_1" dataType="Real" value="125.29"

            FieldEntry fid="14" name="PRCTCK_1" dataType="Enum" value="1"

            FieldEntry fid="15" name="CURRENCY" dataType="Enum" value="840"

            FieldEntry fid="16" name="TRADE_DATE" dataType="Date" value="16 DEC 2020"

            FieldEntry fid="18" name="TRDTIM_1" dataType="Time" value="21:00:00:000:000:000"

           ...

            FieldEntry fid="13583" name="PRE_2ET262" dataType="Enum" value="(blank data)"

            FieldEntry fid="13584" name="PRE_2ET263" dataType="Enum" value="(blank data)"

            FieldEntry fid="14206" name="BLKTIM_MS" dataType="Time" value="21:00:01:885:000:000"

            FieldEntry fid="14213" name="PDTRDTM_MS" dataType="Time" value="(blank data)"

            FieldEntry fid="14238" name="ORDRECV_MS" dataType="Time" value="21:00:00:028:000:000"

            FieldEntry fid="14239" name="TRDRECV_MS" dataType="Time" value="00:00:00:001:000:000"

            FieldEntry fid="14246" name="ORDREC2_MS" dataType="Time" value="(blank data)"

            FieldEntry fid="14247" name="TRDREC2_MS" dataType="Time" value="(blank data)"

            FieldEntry fid="14249" name="CRSTIM_MS" dataType="Time" value="(blank data)"

            FieldEntry fid="14250" name="HLT_RSM_MS" dataType="Time" value="17:13:43:390:000:000"

            FieldEntry fid="14251" name="ODDTIM_MS" dataType="Time" value="20:59:59:441:000:000"

            FieldEntry fid="14257" name="HALT_TM_MS" dataType="Time" value="16:56:17:040:000:000"

            FieldEntry fid="14258" name="OFF_CLS_MS" dataType="Time" value="01:04:00:883:000:000"

            FieldEntry fid="32300" name="CNTX_VER_N" dataType="Int" value="(blank data)"

            FieldEntry fid="32304" name="DM_TYPE" dataType="Enum" value="(blank data)"

            FieldEntry fid="32482" name="ELG_ACVOL" dataType="UInt" value="1290485"

            FieldEntry fid="32560" name="ELG_TNOV" dataType="Real" value="1.62161774265E8"

            FieldEntry fid="32582" name="ODDTRN_UNS" dataType="Real" value="1.3729018755E7"

            FieldEntry fid="32741" name="TRNOVR_UNS" dataType="Real" value="1.7589079302E8"

            FieldEntry fid="32743" name="ACVOL_UNS" dataType="UInt" value="1399612"

        FieldListEnd

    PayloadEnd

RefreshMsgEnd

Once you have successfully completed the steps above, you can further your learning by following the series of EMA tutorials.