RTSDK C++: How to get back instrument data

I am trying to read data for an instrument using RTSDK/C++. I have copied the sample code from Examples/Training/Consumer/400_Series/450_MP_QueryServiceDiscovery/Consumer.cpp and added a handle variable:
// Query endpoints from RDP service discovery for the TCP protocol
ServiceEndpointDiscovery serviceDiscovery(tokenUrl, serviceDiscoveryUrl);
serviceDiscovery.registerClient( ServiceEndpointDiscoveryOption().username( userName ).password( password )
.clientId( clientId ).transport( transportProtocol ).takeExclusiveSignOnControl( takeExclusiveSignOnControl )
.proxyHostName( proxyHostName ).proxyPort( proxyPort ).proxyUserName( proxyUserName ).proxyPassword( proxyPasswd )
.proxyDomain( proxyDomain ), client );
createProgramaticConfig( configDb );
OmmConsumer consumer( config.consumerName( "Consumer_1" ).username( userName ).password( password )
.clientId( clientId ).config( configDb ).takeExclusiveSignOnControl( takeExclusiveSignOnControl )
.tunnelingProxyHostName( proxyHostName ).tunnelingProxyPort( proxyPort )
.proxyUserName( proxyUserName ).proxyPasswd( proxyPasswd ).proxyDomain( proxyDomain ) );
Int64 closure = 1;
UInt64 itemHandle = consumer.registerClient(ReqMsg().serviceName("ELEKTRON_DD").name("IBM.N"), client, (void*)closure);
consumer.reissue(ReqMsg().serviceName("ELEKTRON_DD").name("IBM.N").priority(2, 2), itemHandle);
sleep(60000);
consumer.submit(PostMsg().payload(FieldList().addInt(1, 100).complete()), itemHandle);
sleep( 900000 ); // API calls onRefreshMsg(), onUpdateMsg(), or onStatusMsg()
I get a handle, but the submit() throws an exception:
Attempt to use invalid Handle on submit( const PostMsg& ). Instance name='Consumer_1_1'.
None of the trigger functions, like OnReqMsg() are called
How do I consume data for an instrument?
Should I have a loop, waiting on messages?
Best Answer
-
Am I right in thinking you want to consume data e.g. for IBM.N from ELEKTRON_DD service?
If so, why are you calling reissue and also why are you calling submit with a PostMsg? The submit with PostMsg would only be used if you were Posting/Contributing data to a contribution service. The ELEKTRON_DD service on RTO does NOT accept posting/contributions of data. To contribute data you would need to use a locally deployed Contribution engine OR our Refinitiv Contributions Channel service.
Please work through the EMA C++ tutorials which should provide a good understanding regards the basics of subscribing to an instrument and decoding the response
Also, you mention that none of the on event handlers are being called.
So, what output do you see when you run the Cons450 example without your additional reissue and submit calls? Please provide the console output (minus any credentials)
0
Answers
-
I just want market price data for instruments in the FTSE100 and AIM100 listsDo I need some permissions enabled to get this type of data for an instrument?
0 -
Thanks for replying - however, you have not posted any console output etc as requested above - so we can't take a guess at what might be going wrong? Please provide console output as requested.
Your connection may be failing, your credentials may be wrong, you may not be licenced for the particular instruments you are trying to request.
If you were connecting successfully but not licenced for VOD.L or IBM.N - you would at least expect to see a Status Msg advising that you are not entitled to that RIC.
You may also find a log file in your working folder which you can post.
Also, you can try enabling XML Trace as described in this article - note this will not generate anything unless you actually connect successfully.
Can you also try with a generally free RIC such as 'EUR=' which may help confirm if it is a licence issue or otherwise?
consumer.registerClient(ReqMsg().serviceName("ELEKTRON_DD").name("EUR="), client, (void*)closure);
0 -
Sorry, our application is not a console application, hence why I didn't provide output
I do log to a file and the only event called is onSuccess(), where I print out the host and port:
onSuccess, host eu-west-1-aws-3-sm.optimized-pricing-api.refinitiv.net, port 14002
Also emaLog shows this:
loggerMsg
TimeStamp: 09:43:41.993
ClientName: EmaConfig
Severity: Error
Text: error reading configuration file [EmaConfig.xml]; file is empty
loggerMsgEnd
loggerMsg
TimeStamp: 09:43:41.994
ClientName: EmaConfig
Severity: Error
Text: failed to extract configuration from path []
loggerMsgEnd
loggerMsg
TimeStamp: 09:43:43.678
ClientName: ChannelCallbackClient
Severity: Success
Text: Received ChannelUp event on channel Channel_1
Instance Name Consumer_1_1
Connected component version: ads3.4.2.L1.linux.tis.rrg 64-bit
loggerMsgEnd
I don't get any other events or error. I get a handle back from consumer.registerClient()
I tried the free "EUR=" RIC, but again, I don't get the onReqMsg() event
I believe my credentials are correct, because if I send an invalid item, I do get an error
As I said, the code is literally the same as the example code
0 -
I've just compiled the standalone console example application
Here is the output (removed some services) for RIC EUR=:
Services :
Service :
Provider : aws
Transport : tcp
Endpoint : us-east-1-aws-1-sm.optimized-pricing-api.refinitiv.net
Port : 14002
Data Format : rwf
Location : us-east-1a
Service :
Provider : aws
Transport : tcp
Endpoint : us-east-1-aws-3-sm.optimized-pricing-api.refinitiv.net
Port : 14002
Data Format : rwf
Location : us-east-1a us-east-1b
Service :
Provider : aws
Transport : tcp
Endpoint : us-east-1-aws-2-sm.optimized-pricing-api.refinitiv.net
Port : 14002
Data Format : rwf
Location : us-east-1b
StatusMsg
streamId="5"
domain="MarketPrice Domain"
state="Closed / Suspect / Not entitled / 'Access Denied: User req to PE(526)'"
name="EUR="
nameType="1"
serviceId="257"
serviceName="ELEKTRON_DD"
StatusMsgEnd
For VOD.L:
StatusMsg
streamId="5"
domain="MarketPrice Domain"
state="Closed / Suspect / Not entitled / 'Access Denied: User req to PE(5625)'"
name="VOD.L"
nameType="1"
serviceId="257"
serviceName="ELEKTRON_DD"
StatusMsgEnd
0 -
The above output confirms that whilst your MachineID etc are valid in terms of logging into the server, the actual account has not been licensed correctly - therefore you see the Status Msgs
Closed / Suspect / Not entitled / 'Access Denied: User req to PE(526)'"
Please speak to your Refinitiv Account team to confirm which exchange/asset classes you are permissioned for.
If you have been told you are on a Trial account, then please try using the delayed form of the RICs such as /EUR= and /VOD.L e.g.
consumer.registerClient(ReqMsg().serviceName("ELEKTRON_DD").name("/EUR="), client, (void*)closure);
0 -
@umer.nalla for you help and supportThank you so much
I get data back with the delayed form
I have already requested access to FTSE100 and AIM100 instruments from Refinitiv
0 -
AppClient client;
// create OMM consumer
OmmConsumer consumer(
OmmConsumerConfig()
.host( "ADS:14002" )
.username( "user1" )
);
what will be the Host IP address for TCP/IP login and username?
0
Categories
- All Categories
- 3 Polls
- 6 AHS
- 37 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 698 Datastream
- 1.5K DSS
- 633 Eikon COM
- 5.2K Eikon Data APIs
- 14 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 6 Trading API
- 2.9K Elektron
- 1.5K EMA
- 257 ETA
- 564 WebSocket API
- 40 FX Venues
- 16 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 283 Open PermID
- 47 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2.1K Refinitiv Data Platform
- 799 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
- 122 Open DACS
- 1.1K RFA
- 107 UPA
- 194 TREP Infrastructure
- 232 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 100 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛