question

Upvotes
1 0 0 1

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?

ema-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

sdfsdfsdfsdfsdf
Upvote
20.3k 73 10 20

Hi @manjinder.singh

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)

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Basically I've taken out the reissue and submit lines now and the code just exits without calling any event handlers, even if I try a different instrument, like VOD.L


I just want market price data for instruments in the FTSE100 and AIM100 lists


Do I need some permissions enabled to get this type of data for an instrument?

Upvotes
20.3k 73 10 20

Hi @manjinder.singh

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);

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea