Elektron SDK - Java

API Family: Elektron

EMA Quick Start

Last update May 2018
Environment Windows, Linux
Compilers JDK 1.7 or greater
Prerequisites Setup your build environment as outlined in the ESDK Build System.

Access to an existing TREP or Elektron platform to retrieve content


The goal of this Getting Started tutorial is to provide the developer the steps required to execute an Elektron Message API (EMA) sample application within their environment.  EMA is a sub-component of the ESDK (Elektron 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 ESDK Build System guide, navigate to the example100_MarketPrice_Streaming folder within the ESDK package.  This sample demonstrates the retrieval of market data from Elektron.

To setup this example, you will need to modify the Consumer.java within  example100_MarketPrice_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:


	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 <ESDK root>/Java directory:

> Gradlew runconsumer100

Note: The name of the example above was determined by the examples listing demonstrated within the ESDK 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 runconsumer100
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :Ema:Examples:runconsumer100
May 30, 2018 11:28:00 AM com.thomsonreuters.ema.access.ChannelCallbackClient reactorChannelEventCallback
INFO: loggerMsg
    ClientName: ChannelCallbackClient
    Severity: Info
    Text:    Received ChannelUp event on channel Channel
        Instance Name EmaConsumer_1
        Component Version ads3.0.3.L1.linux.tis.rrg 64-bit

    domain="MarketPrice Domain"
    state="Open / Ok / None / 'All is well'"
    itemGroup="00 06"
    permissionData="03 01 64 62 c0"
    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.15"
            FieldEntry fid="7" name="TRDPRC_2" dataType="Real" value="142.16"
            FieldEntry fid="8" name="TRDPRC_3" dataType="Real" value="142.16"
            FieldEntry fid="9" name="TRDPRC_4" dataType="Real" value="142.18"
            FieldEntry fid="10" name="TRDPRC_5" dataType="Real" value="142.18"
            FieldEntry fid="11" name="NETCHNG_1" dataType="Real" value="0.93"
            FieldEntry fid="12" name="HIGH_1" dataType="Real" value="142.56"
            FieldEntry fid="13" name="LOW_1" dataType="Real" value="141.84"
            FieldEntry fid="14" name="PRCTCK_1" dataType="Enum" value="2"
            FieldEntry fid="15" name="CURRENCY" dataType="Enum" value="840"
            FieldEntry fid="16" name="TRADE_DATE" dataType="Date" value="30 MAY 2018"
            FieldEntry fid="18" name="TRDTIM_1" dataType="Time" value="15:27:00:000:000:000"
            FieldEntry fid="19" name="OPEN_PRC" dataType="Real" value="141.97"
            FieldEntry fid="21" name="HST_CLOSE" dataType="Real" value="141.22"
            FieldEntry fid="22" name="BID" dataType="Real" value="142.15"
            FieldEntry fid="23" name="BID_1" dataType="Real" value="142.15"
            FieldEntry fid="24" name="BID_2" dataType="Real" value="142.15"
            FieldEntry fid="25" name="ASK" dataType="Real" value="142.17"
            FieldEntry fid="26" name="ASK_1" dataType="Real" value="142.17"

            FieldEntry fid="32582" name="ODDTRN_UNS" dataType="Real" value="3755380.683"
            FieldEntry fid="32741" name="TRNOVR_UNS" dataType="Real" value="3.7622663428E7"
            FieldEntry fid="32743" name="ACVOL_UNS" dataType="UInt" value="264707"

    domain="MarketPrice Domain"
    Payload dataType="FieldList"
            FieldEntry fid="22" name="BID" dataType="Real" value="142.15"
            FieldEntry fid="25" name="ASK" dataType="Real" value="142.17"
            FieldEntry fid="30" name="BIDSIZE" dataType="Real" value="2.0"
            FieldEntry fid="31" name="ASKSIZE" dataType="Real" value="1.0"
            FieldEntry fid="6579" name="BID_COND_N" dataType="Rmtes" value="R"
            FieldEntry fid="6580" name="ASK_COND_N" dataType="Rmtes" value="R"
            FieldEntry fid="1000" name="GV1_TEXT" dataType="Rmtes" value=" "
            FieldEntry fid="8937" name="LIMIT_INDQ" dataType="Enum" value="0"
            FieldEntry fid="118" name="PRC_QL_CD" dataType="Enum" value="60"
            FieldEntry fid="3264" name="PRC_QL3" dataType="Enum" value="60"
            FieldEntry fid="8406" name="QTE_ORIGIN" dataType="Rmtes" value=" "
            FieldEntry fid="1041" name="GV1_FLAG" dataType="Rmtes" value=" "
            FieldEntry fid="3887" name="SEQNUM_QT" dataType="Real" value="7936179.0"
            FieldEntry fid="8935" name="RETAIL_INT" dataType="Enum" value="1"
            FieldEntry fid="1501" name="STOCK_TYPE" dataType="Rmtes" value=" "
            FieldEntry fid="12783" name="NBBO_IND" dataType="Enum" value="4"
            FieldEntry fid="3855" name="QUOTIM_MS" dataType="UInt" value="55682592"
            FieldEntry fid="1025" name="QUOTIM" dataType="Time" value="15:28:02:000:000:000"
            FieldEntry fid="6513" name="SETL_TYPE" dataType="Enum" value="5"
            FieldEntry fid="6516" name="BOOK_STATE" dataType="Enum" value="1"
            FieldEntry fid="14238" name="ORDRECV_MS" dataType="Time" value="15:28:02:592:000:000"


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