Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • TREP APIs /
  • RFA /
avatar image
Question by Catherine Wong · Jun 20, 2017 at 10:58 PM · treprfarfa-apijavassl

I need an example application using MarketData/TibMsg interface to parse page data

I cannot find any example application in RFA Java software package to parse page data e.g. RIC 3323bk.HKd.

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

1 Reply

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by pimchaya.wongrukun01 · Jun 20, 2017 at 11:22 PM

Hello @Catherine Wong

The page data can be updated partially. Therefore, the application requires additional steps for processing an update message to display the correct data of the field.

Normally, updates to specific fields would be accomplished by sending the whole data field; however with some large fields this can be inefficient when only a few characters within the data field are to be updated. In such cases the publishing application sends an intra-field positioning sequence within the data field so that the minimum number of characters are transmitted to effect a change.

The syntax of an intra-field positioning sequence is as follows:

<CSI>n<HPA>

Where:

  • <CSI> is the control sequence introducer (this can be a one or two-byte sequence, either Hex 9B or Hex 1b 5b)
  • n is an ASCII numeric string representing the cursor offset position relative to the start of the field.
  • <HPA> is the Horizontal Position Adjust character which terminates the intra-field position sequence (Hex 60 which is an ASCII “ ‘ ”).

The 0x60 byte signals the termination of the partial update positioning sequence. n is a set of numeric digits (0x30 through 0x39) that represent the byte offset position relative to the start of the field. Counting begins with the first byte position being number 0 (zero).

For example, the application receives a refresh message with the field id 318 is:

 4087   -1s  4409  8578 |  3349  3268  8038  8738   

and the following hex update is received:

1b 5b 37 60 38 35 37 37 20 20 33 30 37 37 20 20 36 34 33

The update means update the field at position 7 with “8577 3077 643”

Then after the update is processed, the data of the field id 318 that the application should display is:

 4087  8577  3077  6438 |  3349  3268  8038  8738

The intra-field positioning sequence is supported for fields of the ALPHANUMERIC type.

TibMsg Interface used by MarketData applications provides the following class/constant that helps to interpret partial update:

  • TibMsg.TIBMSG_PARTIAL: Indicates data is partial field type containing offset and content(updated value). Use the class TibPartial for casting and dereference of this type of data.
  • TibPartial : provide methods to get offset(TibPartial.offset) and content(TibPartial.contents) in an partial update message.

Unfortunately, there is no MarketData example application shipped with RFA Java package to process partial updates. However, you can modify the file named MDSubDemoClient.java in MDSubDemo application located in <RFAJ_Package>\Legacy\Examples\com\reuters\rfa\legacyexample\session\mdsub to use the class/constant above to process partial update.

The example source code of modified MDSubDemoClient.java to process partial and full update is below:

public class MDSubDemoClient implements Client
{
    private final MDSubDemo _application;
    TibMsg msg = new TibMsg();
    TibField field = new TibField();
    //The map which keeps the fields(Field id & Value) to be updated
    Map<Integer,String> pageFields;
    …
    public MDSubDemoClient(MDSubDemo subDemo)
    {
        _application = subDemo;
        //initialize the map which keeps fields to be updated
        pageFields = new TreeMap<Integer,String>();
    }
    …
    protected void processMarketDataItemEvent(MarketDataItemEvent marketDataItemEvent)
    {
      …
      if (dict.fhint == Tib.HINT_MFEED_ENUMERATED)
      {
      	…
      }  
      else 
        //System.out.println(field.StringData());
        {  // if the field is not Enumerated type
         if( field.Type() == TibMsg.TIBMSG_PARTIAL ) 
         //update partial field
         { 
          TibPartial p = (TibPartial)field.Data();
          String updateStr = new String(p.contents);
          int offset = p.offset; //offset starts from 0
          System.out.println("fieldId:"+fid + ", offset:"+ offset + ", updateString:" + updateStr);
          StringBuilder value = new StringBuilder(pageFields.get(fid));
          value.replace(offset, offset+updateStr.length(), updateStr);
          pageFields.put(fid, value.toString());
         } 
         else {//update whole field
           pageFields.put(fid, field.StringData());
         }
        }
        …
      System.out.println();
      //display the page after updating all fields of the page
      System.out.println("**********************Updated Page***************************************");
      for (Integer fieldId: pageFields.keySet()){
         System.out.print(fieldId+":");
         System.out.println(pageFields.get(fieldId).toString());  
      }
    }

The example command line to run MDSubDemo 5 minutes(300 seconds) with a user named pimchaya to subscribe a RIC named 3323bk.HKd to the service named ELEKTRON_NEON on the server configured in a consumer session(connection type is SSL) named SSLNamespace::pageSSLSession:

java -cp .;..\..\Libs\rfa.jar com.reuters.rfa.legacyexample.session.mdsub.MDSubDemo -session SSLNamespace::pageSSLSession -serviceName ELEKTRON_NEON -itemName 3323bk.HKd -mounttpi true -user pimchaya -runTime 300

For the help of MDSubDemo, please refer to package.html in <RFAJ_Package>\Legacy\Examples\com\reuters\rfa\legacyexample\session\mdsub

The example output:


sampleconsole-output.png (52.7 KiB)
Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
9 People are following this question.

Related Questions

Subscribing to RIC multiple times

What is the best way to decode the OMMMsgs received (e.g. to get prices) when subscribing to a RIC using RFA?

Java Error contributing data to MARKETLINK

MARKET_BY_PRICE no size

unable to retrieve historical data for ric code GBRPIN=ECI from java api

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges