Sending updates to Refinitiv via MLIP, I was able to update all fids with text strings. Will I be ab
I am replacing an application which sends data to Refinitiv via a MLIP with a EMA C++ application which uses posting to TRCC. Sending updates via MLIP, I was able to update all fids with text strings. Will I be able to do the same using EMA C++ and posting to TRCC?
If not, is there a function to retrieve the 'RWF Type' from the data dictionary by 'Fid', so I can format the data correctly in the payload.
Thanks.
Best Answer
-
I just found other functions from the DataDictionary class and you can use it to get the DictioanryEntry directly by passing fid_id or fid name to the function.
There are functions
DataDictionary::getEntry(thomsonreuters::ema::access::Int16 fieldId)
DataDictionary::getEntry(const thomsonreuters::ema::access::EmaString & fieldName)You can find more details about the functions under DataDictionary class from refman page provided under folder <EMA Install Folder>/Cpp-C/Ema/Docs/refman/ema/index.html
Below is the details of the functions from refman page.
so from my sample codes
DataDictionary dataDictionary; dataDictionary.loadFieldDictionary( "RDMFieldDictionary" ); dataDictionary.loadEnumTypeDictionary( "enumtype.def" );
Then you can call below function to get the type directly but please note that it will throw OmmInvalildUsageException if the fid id does not exist.
dataDictionary.getEntry(fid_id).getRwfType();
You can wrap the function into your own method to handle the exception or call it directly depending on your requirement.
0
Answers
-
Hello @efreeman
Please see the following resource regarding how to contribute data to TRCC with Elektron SDK
- Contributing your data to Refinitiv article
- EMA C++ Consumer tutorial - Posting data to TR Contribution Channel
1 -
As far as I understand MLIP uses legacy SSL protocol which transfers data as a text string so you can update all fids with text. But for TRCC it uses RWF binary format, therefore, you have to update the fids using the type defined in the dict.
To get the RWF Type for specific fid you can use DataDictionary class to load data dictionary like the example IProvider example 332__Dictionary__UserControl or 350__Dictionary__Streaming.
You may load the Dict from a local file using
DataDictionary dataDictionary; dataDictionary.loadFieldDictionary( "RDMFieldDictionary" ); dataDictionary.loadEnumTypeDictionary( "enumtype.def" );
And then get dictionary entries using
const auto& dictEntries = dataDictionary.getEntries();
Then you can call
dictEntries[fid_id].getRwfType();
which will return RWFType enum value defined in DataType.h and it will throw OmmOutOfRangeException if the fid_id is not available in dictEntries.
For example,
Enum value 8 is RealEnum.
You may create a utility function like below sample codes to get the type.
int AppClient::get_fid_rwf_type(const EmaVector<DictionaryEntry>& dict_entries, const int fid_id)
{
unsigned int index = 0;
while (index < dict_entries.size() && dict_entries[index].getFid() != fid_id) index++;
if (index >= dict_entries.size())
return -1;
else
return dict_entries[index].getRwfType();
}0 -
Hi Moragodkrit,
That is exactly what I was looking for. Excellent explanation. I will test as soon as I can.
Thanks.
0 -
Hi Moragodkrit,
I am able to use your examples above to retrieve the Rwf Type. It seems to work but, I am receiving many discrepancies.
Fid
0 -
Hi Moragodkrit,
I am testing the above to retrieve Rwf Type, but I am receiving many discrepancies. Here are some examples :
fid RDMFieldDict dict_entries[fid].getRwfType()
3 RMTES_STRING 14
79 DATE 8
339 RMTES_STRING 8
996 REAL64 14
1003 RMTES_STRING 8
I need to get correct Rwf Type to post FID data using correct data types.
Thanks.
0 -
Sorry, my understanding of the DictionaryEntries indexer is not correct. It does not support direct access to the dictionary entry using the indexer. It looks like we need to iterate through the EmaVecter, which holds the DictionaryEntry to check if the entry contains the fid id and then return the rwf type.
I have updated the codes and test them again, and below is my test result, new codes returns the correct rwf type. Can you test it again and let me know the result?
Fid#3 RMTES_STRING DataType:19
Fid#79 DATE DataType:9
Fid#339 RMTES_STRING DataType:19
Fid#996 Real64 DataType:8
Fid#1003 RMTES_STRING DataType:19
Fid#32766 MAP DataType:137
Fid#-2 Unknown DataType:-1Anyway, based on the way we use to retrieve the type, it's not a good idea to call the method to check the type every time we publish the data, so you might need to cache the type in your data structure, and you can re-use it later.
0 -
Hi Moragodkrit,
dataDictionary.getEntry(fid_id).getRwfType()
worked perfectly.
Do I have to worry about performance? Is it using a map or index into a table?
Thanks.
0 -
Based on the ESDK source file from GitHub https://github.com/Refinitiv/Elektron-SDK/
It looks like the EMA internal implementation keeping the raw data for dictionary entry in the array, and it indexed by FieldId. Therefore the getEntry method should be able to access dictionary entry directly when passing fid id to the function.
0 -
Hi Moragodkrit,
Thanks for looking into that. This is exactly what I need.
0
Categories
- All Categories
- 6 AHS
- 39 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
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛