How do I read in data from a non-TREP source in order to post to TRCC?
Hello, This goes back to my original question where I asked how to replace an application which contributed data to Reuters via MLIPs. I was pointed to using EMA Consumer with posting. I have successfully been able to connect to a test TRCC and post a test message using 'EMA Consumer - Posting data to TR Contribution Channel' sample program.
My question now is, how do I feed in non-TREP based data to be posted. The previous MLIP oriented application received data via a direct socket connection to a source which uses a different message protocol. Can this be done using EMA? How do I tap into the main loop of a EMA Consumer application.
Best Answer
-
Hi @efreeman
Am I right in assuming that you referring to the TRCC tutorial as a basis for your new implementation?
If so, you will note that in that example, once you get a MMT_SYSTEM RefreshMsg with the subStreamHandle (which was registered in the onUpdateMsg method) then the example sends out the first Post:
if (refreshMsg.getDomainType() == MMT_SYSTEM &&
event.getHandle() == _subStreamHandle &&
refreshMsg.getState().getStreamState() == OmmState::OpenEnum &&
refreshMsg.getState().getDataState() == OmmState::OkEnum)
{After that, once it receives an Ack for the above Post, it continues to send out Update Post messages.
The above is done is this way as it is a purely educational example.
For a real life implementation such as yours, once you get back that initial MMT_SYSTEM Refresh with the subStreamHandle, you can start sending out Post Messages as and when required based on your implementation requirements.
In the above example the main application thread sends the MMT_LOGIN and then just sleeps for several minutes - to allow the example to login, create the substream and send several post messages (all done via the callbacks on the API thread) before finally exiting.
So, instead of sleeping the main thread, you could wait on an indicator flag - which you would set when above RefreshMsg has been received. Once the indicator flag has been set, you can start posting from the main thread as and when required.
You could also look at example 130_MarketPrice_UserDisp which lets you control the dispatching of the events rather than letting the API dispatch the events (behind the scenes) as with the TRCC example.
unsigned long long startTime = getCurrentTime();
while ( startTime + 60000 > getCurrentTime() )
consumer.dispatch( 10 ); // calls to onRefreshMsg(), onUpdateMsg(), or onStatusMsg() execute on this threadSo, with the above implementation - in addition to calling dispatch, you could add your additional control code to the same while loop e.g. waiting for the Substream to be established and then sending your Posts as and when required. The key thing is to keep calling dispatch to ensure the the API continues to process events/message between your application and the server.
You can read more about Dispatching etc in the EMACPP_DevGuide.pdf which comes with the Elektron SDK and can be found in the ema\docs subfolder.
0
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
- 685 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
- 252 ETA
- 556 WebSocket API
- 38 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
- 652 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
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 228 TRKD
- 917 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 中文论坛