Convert RefreshMsg(C++) to rsslRefreshMsg for encode then decode back
Hi I want to save RefreshMsg to file and later replay it. I saw the forum has getEncodedBuffer and setEncodedBuffer but I can't fine it in Ema. I saw there is an example in unit doing this:
rsslEncodeMsg(&encIter, (RsslMsg*)&refresh);
But what I have is RefreshMsg not rsslRefreshMsg, when I tried to do encoding above it seems fine. but when I decode it.
RsslMsg refreshDecode;
retval = rsslDecodeMsg(&decodeIter, (RsslMsg*)&refreshDecode);
It failed to decode here I think itis because already message is RefreshMsg not rsslRefreshMsg so c casting is not right. So I think I need to convert RefreshMsg to rsslRefreshMsg to encode it. But I don't know how.
Best Answer
-
EMA provides an interface to access the hex buffer. For example:
void AppClient::onRefreshMsg( const RefreshMsg& refreshMsg, const OmmConsumerEvent& )
{
cout << refreshMsg << endl; // defaults to refreshMsg.toString()
const EmaBuffer& buffer = refreshMsg.getAsHex();
cout << "Length:" << buffer.length() << endl;
cout << buffer.asRawHexString() << endl;
}However, I can't find a way to convert the raw buffer back to RefreshMsg.
The unit test example (RTSDK-2.1.1.L1.win.rrg\Cpp-C\Ema\Examples\Test\UnitTest\RefreshMsgTests.cpp) shows how to use the StaticDecoder::setRsslData method to get an EMA RefreshMsg from an ETA RsslMsg. However, I think it is for testing purpose.
If you have Refinitiv Developer Connect (RDC) contacts, you can submit this query to the API support via Contact Premium support to verify this kind of usage. Otherwise, you can submit this question to the developer team directly via GitHub.
0
Answers
-
Thank you for reaching out to us.
The Refinitiv Real-Time SDK contains two APIs (EMA and ETA). EMA is built on top of ETA.
EMA is the high level and ease of use API that operates data at the message level, such as RefreshMsg, and UpdateMsg. ETA is the low level and high performance API that operates data at the transport and buffer level. rsslEncodeMsg, rsslDecodeMsg, and RsslMsg are interfaces in ETA which don't work with EMA classes.
Moreover, the APIs don't provide any interfaces to convert EMA RefreshMsg to ETA RsslRefreshMsg, or vice versa.
If you would like to record and replay data, you can use the testclient and testserver tools. For more information, please refer to the Quick Start Guide to Recording and Playback of Refinitiv Real-Time Data article
0 -
We can't use testclient/testserver tools in our local and our production environment (they are closed source and we can't use them without breaking our security policy). We have to write code to encode/decode message. If eta is raw transport buffer level, when I get callback using EMA what I have is RefreshMsg, it means it converts rssl(ETA) to EMA. I must be able to get raw buffer and dump to disk, next time I can read it back and convert to EMA myself since this way the only difference is network buffer vs disk buffer. Please advise, how do I: 1) get hold on underlying buffer from RefreshMsg later on 2) how to convert saved buffer to RefreshMsg?
0 -
Will do. Opening RDC ticket now, thanks.
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 中文论坛