Regarding data
In my code where I receive data from Reuters, I am giving a milliseconds of 500. So at intervals of 500 milliseconds, it reads the data. Are we missing any data if we increase the time?
Best Answer
-
@liyarthomas your code does not show the event dispatch and callback handler. Application has to receive data from EMA not poll it. If the ticks are not removed from EMA fast enough, then queue will fill up and application will run out of heap memory.
0
Answers
-
Hi @liyarthomas
Depending on the volatility of the instruments you are consuming and the service you are consuming from, there could well be much higher update rates.
Are you using streaming requests or snapshot requests?
Can you confirm what you mean by 'at intervals of 500ms it reads the data' - how exactly are you controlling this?
The event callback handlers in EMA (onRefreshMsg, onUpdateMsg etc) are event driven and called as & when any new updates arrive from the server - provided that you are continuously dispatching events.
Are you limiting the calls to dispatch() to once every 500ms? If so, any updates received from the server could start building up in a queue and your callbacks will only receive the next one in the queue as and when dispatch is called. If you do not call dispatch often enough for a instrument that updates more frequently - you may not get all the updates...
Please explain how your interval reading is working....
0 -
We are using an Asynchronous server here which reads the data store every 200 milliseconds and publishing it into the zero MQ.
The event callback handlers in EMA are event driven and are called as and when any new updates arrives from server.
I have attached here just two files which does the following. But I have not attached the event driven appclient.
So what we wanted to know is that, as we are reading the datastore every 200ms, are we missing any ticks?
using namespace thomsonreuters::ema::access;
using namespace thomsonreuters::ema::rdm;
using namespace std;
int main(int argc, char* argv[])
{
try {
// instantiate callback client
mdsdemo::DataStore ds;
mdsdemo::AppClient client(ds);
//ip, port, interval, datastore
mdsdemo::AsyncServer as("*", 40000, 1000, ds );
cout << "Connecting to market data server" << endl;
// create OMM consumer
OmmConsumer consumer(
OmmConsumerConfig()
.host("159.220.108.133:14002")
.username("NJ2_03_RHB_SWVPNTRIAL01")
);
cout << "Subscribing to market data" << endl;
std::vector<string> rics = {
"USDEUR=R","JPYUSD=R","USDGBP=R","USDAUD=R","CHFUSD=R", "CADUSD=R"
};
for (const auto ric : rics)
{
//first setup datastore for the ric
ds.AddStorage(ric, new mdsdemo::FxData());
// subscribe to Level1 market data
consumer.registerClient(
ReqMsg()
// default subscription domain is MMT_MARKET_PRICE
.serviceName("hEDD")
.name(ric.c_str()),
client);
}
//run asynchronously reading the data store every 1000 milliseconds and publishing into the
//queue
as.RunForEver();
}
catch (const OmmException& excp) {
cout << "Exception subscribing to market data: " << excp << endl;
}
return 0;
}#include <sstream>
#include <iostream>
#include <boost/bind.hpp>
#include "AsyncServer.h"
using std::cout;
using std::endl;
namespace mdsdemo
{
AsyncServer::AsyncServer(string ip, int port, long interval, DataStore & ds)
:context_(1), pub_(context_, ZMQ_PUB), interval_(interval), ds_(ds)
{
std::stringstream ss;
ss << "tcp://" << ip << ":" << port;
pub_.bind(ss.str());
}
AsyncServer::~AsyncServer()
{
}
void AsyncServer::RunForEver()
{
boost::asio::deadline_timer t(io_, boost::posix_time::millisec(interval_));
t.async_wait(boost::bind(&AsyncServer::OnTimer, this,
boost::asio::placeholders::error, &t));
io_.run();
}
void AsyncServer::Publish()
{
try {
std::string jsonData = "full ";
jsonData +=
ds_.ToJsonFull();
zmq::message_t msg(jsonData.begin(), jsonData.end());
pub_.send(msg);
cout << jsonData << endl;
}
catch (const std::exception & exp)
{
//TODO log errors
}
}
void AsyncServer::OnTimer(const boost::system::error_code& /*e*/,
boost::asio::deadline_timer* t)
{
Publish();
t->expires_at(t->expires_at() + boost::posix_time::millisec(interval_));
t->async_wait(boost::bind(&AsyncServer::OnTimer, this,
boost::asio::placeholders::error, t));
}
}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 中文论坛