EMA SDK examples to parse page based data
Hello,
Are there any examples provided in EMA SDK to parse page based data?
Thank you.
NWM
Best Answer
-
Hello @NWM
You can use example102__MarketPrice__Snapshot to send a snapshot item/RIC request to snapshot the page. Hence, you will get only a refresh message containing the latest data of all available fields of the RIC at that time; there is no any update message after the refresh message. The example calls ReqMsg.interestAfterRefresh(false) to specify that snapshot item is requested as code below:
consumer.registerClient(reqMsg.serviceName("DIRECT_FEED").name("IBM.N").interestAfterRefresh(false), appClient);
Whenever the application want to snapshot the page, it needs to send a snapshot RIC request by calling consumer.registerClient(..) as the source code above.
Normally, a page is shown via the field named ROW64_1(field id 215) to ROW64_14(field id 228) or ROW80_1(field id 315) to ROW80_25(field id 339). Please refer to decode(FieldList fieldList) method in example120__MarketPrice__FieldListWalk which shows how to get the field id.
The example of a page display in ROW64_n fields:
The example of a page display in ROW80_n fields:
0
Answers
-
Hello @NWM,
The page can be update partially by the provider sends an intra-field positioning sequence
within the data field. Hence, the application requires additional steps for processing an
update message to display the correct data of the field.The syntax of an intra-field
positioning sequence is as follows:Where:
- <CSI> is the control sequence introducer (this can be a
one or two-byte sequence, either Hex 9B or Hex 1B5B)
- 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 Field Id 317 is:7189 4378 3077 6438 | 6438
6387 3269 5465and the following update is received:
FIELD_ENTRY 317: 1b5b313460343433202037383137
Hex "1b5b313460343433202037383137" means update the
field at position 14 with “443 7817”Then after the update is processed, the data of field 317 that
the application should display is:7189 4378 3443 7817 | 6438
6387 3269 5465EMA provides RmtesBuffer.apply() to interpret the intra-field position. Even there is no example to parse page data in EMA but you can modify example120__MarketPrice__FieldListWalk shipped with EMA Java package to parse page data as the snipped source code below:
class AppClient implements OmmConsumerClient
{
//a Map keeps field Id as a key with RmtesBuffer
TreeMap <Integer, RmtesBuffer> rmtesMap = new TreeMap <Integer, RmtesBuffer>();
…
void decode(FieldList fieldList)
{
Iterator<FieldEntry> iter = fieldList.iterator();
FieldEntry fieldEntry;
while (iter.hasNext())
{
fieldEntry = iter.next();
//not print a value of each field
//System.out.println("Fid: " + fieldEntry.fieldId() + " Name: " + fieldEntry.name() + " value: " + fieldEntry.load());
//apply() call for any RMTES field which is not blank
if(fieldEntry.loadType()==DataTypes.RMTES & fieldEntry.code()!=Data.DataCode.BLANK)
{
//if the field id does not exist in the map, create new RmtesBuffer object
if(!rmtesMap.containsKey(fieldEntry.fieldId()))
{
rmtesMap.put(fieldEntry.fieldId(), EmaFactory.createRmtesBuffer());
}
//call apply() to interpret the intra-field position
rmtesMap.get(fieldEntry.fieldId()).apply(fieldEntry.rmtes());
}
}
//prints all RMTES fields(the field id with its value) in the map on the console to display the page
for (Integer fieldId: rmtesMap.keySet())
{
System.out.print(fieldId+":");
System.out.println(rmtesMap.get(fieldId).toString());
}
}
…
}0 - <CSI> is the control sequence introducer (this can be a
-
thanks for sharing your opinions, but what do you guys think about Back4app as the best Parse Alternative for developing scalable and extensible applications? Is anyone using the platform?
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛