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
Categories
- All Categories
- 3 Polls
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 615 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 249 ETA
- 554 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 643 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 192 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛