question

Upvotes
Accepted
22 0 3 9

How can I pull sofr rics with java project?

Merhabalar,

Bizim spring boot üzerinde çalışan bir yazılımımız var. Bu yazılım, reuters’den bazı ricleri çekebilirken, sofr türündeki ricleri, çekme yetkimiz olduğu halde çekemiyor. Size ait Ema, Eta ve SpeedGuide projeleri olduğunu öğrendik. Bu projelerden nasıl faydalanacağımızı bilmiyoruz. Sofr riclerini nasıl çekebileceğimize dair örnek kod ya da bir doküman var mıdır?

Hello,

We have software running on spring boot. While this software can pull some rics from Reuters, it cannot pull sofr type rics even though we have the authority to pull them. We learned that you have Ema, Eta and SpeedGuide projects. We do not know how we will benefit from these projects. Sample code on how we can pull their sofr rics or Is there any document or sample code on how we can pull the sofr rics?

#technologyema-apiricsjavaeta-apispeedguide
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
Accepted
24.4k 53 17 14

Hello @SelcukYAPICI

Thank you for the information. Please confirm my understanding below:

  1. Based on a given configDb source code, are you using the Robust Foundation API (RFA) - Java edition with your current Spring app?
  2. If you are using the RFA Java API, it means the application connects and consumes data from your local Refinitiv Real-Time Distribution System (RTDS/RMDS/TREP/ADS)

Then:

  • Scenario A: Your current RFA - Spring app cannot consume some RICs (you got permission denied response message may I presume?), so you want to migrate the app to use the RTSDK instead

Or

  • Scenario B: You intend to migrate your app to use RTSDK in the first place

If the issue is Scenario A, I think we should take a step back and verify why the problem occurs. If you can replicate the issue on demand, please enable the RFA log file and share a log to let us verify incoming/outgoing messages between the API and server.

You can enable the RFA log file with the ipcTrace = 7 and mountTrace = true configurations as follows:

Config Editor UI:

rssl-config.png

Config XML:

<namespace>/Connections/<Connection Name>/ipcTraceFlags = 7
<namespace>/ Connections/<Connection Name>/mountTrace = True
<namespace>/ Connections/<Connection Name>/logFileName=<path to log file>

ConfigDb Code:

ConfigDb configDb = new ConfigDb();
configDb.addVariable("NameSpace.Sessions.rsslConSession.connectionList","rsslConConnection");
configDb.addVariable("NameSpace.Connections.rsslConConnection.mountTrace","true");
configDb.addVariable("NameSpace.Connections.rsslConConnection.ipcTraceFlags","7");
configDb.addVariable("NameSpace.Connections.rsslConConnection.logFileName","C:\\logs\\RFA_RSSL%u.log");
configDb.addVariable("NameSpace.Connections.rsslConConnection.connectionType","RSSL");
configDb.addVariable("NameSpace.Connections.rsslConConnection.serverList","ADS_HOST");
configDb.addVariable("NameSpace.Connections.rsslConConnection.portNumber","14002");
Context.initialize(configDb);

rssl-config.png (7.6 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
24.4k 53 17 14

Hello @SelcukYAPICI

I do not know what kind of "SOFR" RICs are, but if the data is available on the Refinitiv Real-Time platform, you can use the Refinitiv Real-Time SDK to consume data from the deployed Refinitiv Real-Time Distribution System (on-prem RTDS) or Refinitiv Real-Time -- Optimized (cloud - RTO).

Firstly, I highly recommend you check these articles that give you an overview of Refinitiv Real-Time and the Real-Time APIs:

Moving on to the RTSDK Java edition, the SDK consists of two APIs as follows:

  • Enterprise Transport API (ETA): A low-level, ultra-high performance, low latency transport API.
  • Enterprise Message API (EMA): A message-level (high-level), data-neutral, multi-threaded, ease-of-use API that is built on top of the ETA API.

You can check the following resources to understand the overview of the EMA API.

The RTSDK Java resources (quick start guide, step-by-step tutorials, documents, API/Example download) are available here:

The EMA and ETA API examples (source code, readme, configurations, etc.) are bundled in the SDK package.

Hope this helps.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
22 0 3 9

Hi Wasin.
I can consume "USDSOFR=, .SR1M, .SR3M, .SR6M, .SR1Y" rics from reuters. Unfortunately, I can't consume ".SOFR, SOFR1MAVG=, SOFR3MAVG=, SOFR6MAVG=, .RFTSOFRTR" rics. I am authorized to consume these species. Because I can watch over DACS. I am going to examine articles that you sent.


Thanks for your reply.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
24.4k 53 17 14

Hello @SelcukYAPICI

I am sorry to hear that you are facing the issue.

Can you give me more detail about how you cannot consume the .SOFR, SOFR1MAVG=, SOFR3MAVG=, SOFR6MAVG=, and .RFTSOFRTR RICs?

  • Are there any error messages?
  • How do you consume the RICs?
  • Which API are you using?
  • Is it connected to your local RMDS or Cloud (RTO)?

Please noted that when consuming data from Refinitiv Real-Time APIs with DACS, you need to specify a valid DACS user that has permission to request data from a valid Service.

I did a quick test with the EMA Java consumer ex370_MP_Batch to consume those RICs from my local RTDS. It can consume the RICs data successfully.

Example code:

consumer  = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig().host("localhost:14002").username("<DACS Username>"));
            
ElementList batch = EmaFactory.createElementList();
OmmArray array = EmaFactory.createOmmArray();
       
array.add(EmaFactory.createOmmArrayEntry().ascii(".SOFR"));
array.add(EmaFactory.createOmmArrayEntry().ascii("SOFR1MAVG="));
array.add(EmaFactory.createOmmArrayEntry().ascii("SOFR3MAVG="));
array.add(EmaFactory.createOmmArrayEntry().ascii("SOFR6MAVG="));
array.add(EmaFactory.createOmmArrayEntry().ascii(".RFTSOFRTR"));


batch.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_BATCH_ITEM_LIST, array));
consumer.registerClient(EmaFactory.createReqMsg().serviceName("<Service Name>").payload(batch), appClient);


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
22 0 3 9

Hi Wasin,
I think that you are very succeeded in correct orientation. I use "ema-3.6.7.3.jar" in my spring project. When I write the code below.


public ConsumerClient() {
        System.out.println(" *******************  Class is started for consume Sofr rics...");
        _consumer = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig().host("localhost:14002").username("<My DACS Username>"));

}

When I run the code I get the following error.


*******************  Class is started for consume Sofr rics...
Exception in thread "main" java.lang.NoClassDefFoundError: com/refinitiv/eta/valueadd/domainrep/rdm/login/LoginMsgFactory
at com.refinitiv.ema.access.EmaConfigImpl.<init>(EmaConfigImpl.java:112)
at com.refinitiv.ema.access.OmmConsumerConfigImpl.<init>(OmmConsumerConfigImpl.java:20)
at com.refinitiv.ema.access.EmaFactory.createOmmConsumerConfig(EmaFactory.java:430)
at tr.gov.hazine.reuters.custom.sofr.ConsumerClient.<init>(ConsumerClient.java:12)
at tr.gov.hazine.reuters.custom.ista.Ista.main(Ista.java:125)
at tr.gov.hazine.reuters.custom.ista.ClientTest.<init>(ClientTest.java:15)
at com.example.demoFirstRestFulWebService.DemoFirstRestFulWebServiceApplication.main(DemoFirstRestFulWebServiceApplication.java:45)
Caused by: java.lang.ClassNotFoundException: com.refinitiv.eta.valueadd.domainrep.rdm.login.LoginMsgFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more


what should I write instead of "localhost:14002". When I consume the other rics (for example ".SR1M"). I use below code.

configDb = XConfigDbFactory.createFromCommandLine(commandLine);
String serviceName = configDb.variable(_appId, "serviceName", "IDN_RDF").toString();
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
24.4k 53 17 14

Hello @SelcukYAPICI

If your requirement is Scenario B, I highly recommend you start with a simple console example first. The recommended examples for getting started using the EMA Java API are as follows:

  • The EMA Consumer ex100_MP_Streaming example: The file is available in the SDK package ./Ema/Examples/src/main/java/com/refinitiv/ema/examples/training/consumer/series100/ex100_MP_Streaming folder
  • The tutorial examples: The tutorial source code provides step-by-step code and source files that guide you to each step of using the API. You can download the tutorial code package from the download link.

Together with the ex100_MP_Streaming example, you can check the RTDS connection quick guide about how to configure the example to connect to your local RTDS server and service.

The step-by-step tutorials are available here.

In order to connect the EMA consumer to your local RTDS, you need the following information:

  • the RTDS server IP or Hostname
  • the RTDS server must enable the RSSL connection
  • the RTDS server RSSL port
  • Your Market data service name
  • DACS username.

Then configure them in the source code as follows:

consumer  = EmaFactory.createOmmConsumer(config.host("<RTDS IP/Hostname>:<RTDS RSSL port>").username("<DACS username>"));
...
consumer.registerClient(reqMsg.serviceName("<RTDS service name>").name("<RIC name>"), appClient);

Please contact your Market Data team to get more detail about your RTDS/Market Data System information.

Besides the API and Refinitiv Real-Time resources that I already gave you in the first post, there is the Migrating from the Legacy Robust Foundation API (RFA) to the Enterprise Message API (EMA) article that might help you too.



icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Additionally, the EMA Java application does not need only ema-<version>.jar, the API needs the ETA library and other dependencies jar files too.

  • The ETA libraries files are available at <RTSDK Java Package>\Java\Eta\Libs folder
  • The Apache jar files are available at <RTSDK Java Package>\RTSDK-BinaryPack\Java\Ema\Libs folder
  • The SLF4J jar files are available at <RTSDK Java Package>\RTSDK-BinaryPack\Java\Eta\Libs\SLF4J\slf4j-1.7.32
  • You may need the jackson-*.jar and json-*.jar files from the <RTSDK Java Package>\RTSDK-BinaryPack\Java\Eta\Libs folder too

The SDK uses Gradle build tool and the SDK is available on the Maven Central repository, so you can use Gradle, Maven, or other build tools to match your requirement.

If you use Maven, this How to Set Up Refinitiv Real-Time SDK Java Application with Maven article should help you.


Upvotes
22 0 3 9

Hi,

While cursor on bellow code;

ReqMsg reqMsg = EmaFactory.createReqMsg();

I get bellow error.

"Decoding of just encoded object in the same application is not supported"

Is this normal? or I did wrong some things.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
22 0 3 9

Also, I get log message while run bellow code

_consumer.registerClient ......

2023-01-16T17:19:57.267+03:00 INFO 18692 --- [ Thread-1] c.refinitiv.ema.access.OmmConsumerImpl : loggerMsg

ClientName: EmaConfig

Severity: Info

Text: Missing, unreadable or empty file configuration, path=[C:\Users\name.surname\IdeaProjects\ConnectToEma\EmaConfig.xml]

loggerMsgEnd


2023-01-16T17:19:57.306+03:00 INFO 18692 --- [ Thread-1] c.refinitiv.ema.access.OmmConsumerImpl : loggerMsg

ClientName: ChannelCallbackClient

Severity: Info

Text: Received ChannelUp event on channel Channel

Instance Name EmaConsumer_3

Component Version ads3.5.2.L1.linux.rrg 64-bit

loggerMsgEnd



icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
24.4k 53 17 14

Hello @SelcukYAPICI

Thank you for contacting us, please see the answers below.

### Decoding of just encoded object in the same application is not supported ###

I can replicate the issue in my environment. When debugging EMA Java applications (like EMA Java consumer ex100_MP_Streaming example), the API shows "Decoding of just encoded object in the same application is not supported" after a debug cursor passes the ReqMsg reqMsg = EmaFactory.createReqMsg(); statement line.

emaj-debug.png

Once I resume the application or run debug step further, it works fine.

Based on my research, this message always appears if the application immediately retrieves data from freshly created OMM containers or messages. The EMA API does not support this kind of functionality.

In this case, the code just creates a new ReqMsg object. The ReqMsg object also works fine too. So I am assuming it might be an expected behavior. However, I have submitted question #232 to the RTSDK team to verify this debugging behavior.

### Missing, unreadable or empty file configuration, path ... ###

Please be informed that it is just an information log, not an error log. The API automatically looks for the EmaConfig.xml configuration file from the following locations by default

  1. The application path
  2. Optional path based on developers' preference (see example ex111_MP_UserSpecifiedFileCfg)
  3. Classpath resource

If the API cannot find the EmaConfig.xml file, it logs that "INFO" message and take the configurations from the application code instead.

Please see more detail about EMA API configurations from this Enterprise Message API (EMA) - Configuration Overview article.

Hope this helps.


emaj-debug.png (172.5 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
22 0 3 9

Hi @wasin.w,

Thank you for your replies. I run below code.

capture.png


Everythings are ok until here. But I want to get below values.

cadfspture.png


How can I get these values? (picture above belong to speed guide).

Best regards.



capture.png (62.7 KiB)
cadfspture.png (23.6 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
22 0 3 9

Hi @wasin.w ,


I found out it. I should have done it with below.

public class MyConsumerClient implements OmmConsumerClient {
    @Override
    public void onRefreshMsg(RefreshMsg refreshMsg, OmmConsumerEvent ommConsumerEvent) {
        System.out.println("onRefreshMsg..." + refreshMsg);
    }


thanks for your replies.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
24.4k 53 17 14

Hello @SelcukYAPICI

I am glad to hear that you have found the answer. Please let me explain in a bit more detail below.

### EMA API Callback ###

This is the code that EMA API request data from the backend:

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

The "appClient" is a consumer client class that provides a callback mechanism for EMA to send incoming messages to the application.

  • For each valid request, your application will then receive a refresh response message which reflects the current market state for that instrument. A refresh message is sometimes called "Image" data. The refresh will contain every single possible field that relates to that instrument – even if that field is blank or empty at that moment in time.
  • Following the refresh response, your application will then receive the update response messages as and when there is any change to the market state for the instrument. Unlike the refresh message, the update typically only contains those fields that have changed since the refresh response or previous update response.

The API sends data to a consumer client class ("appClient") via the following callback methods:

  • Refresh response message: onRefreshMsg() method
  • Update response message: onUpdateMsg() method
  • Status response message: onStatusMsg() method
  • and so on.

### Data Structure ###

Most of the items distributed on Refinitiv Real-Time platforms use the field list data structure. This data structure is made of a list of field/value pairs that transport several values of an item.

Each element of a field list has a unique field ID (FID) and a value. OMM messages that contain Field Lists only transport these two elements. Other information like the name of the field or the type is defined within a field dictionary that is either downloaded from the real-time platform or provided as a file beside the application. Our Real-Time APIs extensively use this dictionary to decode the fields they receive from the platform.

market-price.png

You can find how to iterate the FieldList object to get each field ID and value from the FieldEntry from the EMA Java ex120_MP_FieldListWalk consumer example as follows:

public void onRefreshMsg(RefreshMsg refreshMsg, OmmConsumerEvent event) {
    if (refreshMsg.hasName())
        System.out.println("Item Name: " + refreshMsg.name());
        
    if (refreshMsg.hasServiceName())
        System.out.println("Service Name: " + refreshMsg.serviceName());
        
    System.out.println("Item State: " + refreshMsg.state());
        
    if (DataType.DataTypes.FIELD_LIST == refreshMsg.payload().dataType())
        decode(refreshMsg.payload().fieldList());
        
    System.out.println("\n");
}

void decode(FieldList fieldList){
    Iterator<FieldEntry> iter = fieldList.iterator();
    FieldEntry fieldEntry;
    while (iter.hasNext()){
        fieldEntry = iter.next();
        System.out.println("Fid: " + fieldEntry.fieldId() + " Name: " + fieldEntry.name() + " value: " + fieldEntry.load());
    }
}

For more advanced field data parsing examples, please see the series300.ex360_MP_View consumer example.

### View Request ###

By default, the API automatically requests all available field data for the application. However, you may need only a few field data for each item. The API lets you specify the interested fields in the request message via the View feature.

Example for requesting only BID and ASK fields:

ElementList view = EmaFactory.createElementList();
OmmArray array = EmaFactory.createOmmArray();
            
array.fixedWidth(2);
array.add(EmaFactory.createOmmArrayEntry().intValue(22));
array.add(EmaFactory.createOmmArrayEntry().intValue(25));


view.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
view.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, array));
            
consumer.registerClient(EmaFactory.createReqMsg().serviceName("DIRECT_FEED").name("IBM.N").payload(view), appClient);

please see the series300.ex360_MP_View consumer example.

### Decoding of just encoded object in the same application is not supported ###

The RTSDK team confirms that it is the expected behavior when debugging that statement with IDE. The IDE is attempting to call "toString()" method on that reqMsg statement during debug to give you the string information about the object.

That is why this message appears because the IDE immediately retrieves data from freshly created OMM containers or messages.

Additionally, there are two resources that I highly recommend you to be more familiar with the Refinitiv Real-Time:



market-price.png (59.3 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.