I cannot find any example application in RFA Java softwarepackage to parse page data e.g. RIC 3323bk.HKd.
Hello @Catherine Wong
The page data can be updated partially. Therefore, theapplication requires additional steps for processing an update message todisplay the correct data of the field.
Normally, updates to specific fields would be accomplished bysending the whole data field; however with some large fields this can be inefficientwhen only a few characters within the data field are to be updated. In suchcases the publishing application sends an intra-field positioning sequencewithin the data field so that the minimum number of characters are transmittedto effect a change.
The syntax of an intra-field positioning sequence is as follows:
<CSI>n<HPA>
Where:
The 0x60 byte signals the termination of the partial updatepositioning sequence. n is a set of numeric digits (0x30 through 0x39) thatrepresent the byte offset position relative to the start of the field. Countingbegins with the first byte position being number 0 (zero).
For example, the application receives a refresh message with thefield 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 318that 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 thefollowing class/constant that helps to interpret partial update:
Unfortunately, there is no MarketData exampleapplication 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\mdsubto use the class/constant above to process partial update.
The example source code of modified MDSubDemoClient.java to processpartial 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 5minutes(300 seconds) with a user named pimchaya to subscribe aRIC named 3323bk.HKd to the service named ELEKTRON_NEON on theserver 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: