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.
1
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 中文论坛