question

Upvotes
Accepted
20 1 3 4

Running Elektron-SDK's C++ Example Step5 : 'Service name of 'LDN_RSSL_DDS_CHE' is not found.'

Hello,

STEP1

----------

we installed and configured software named "EZD 1.2" on a computer with Windows Server 2008 R2 Standard operation system. Then we run in command line:

ezd.eze -nodaemon

and we can see the window

STEP2

---------

we downloaded Elektron SDK - C/C++ - 1.1.0 - Windows and the examples from https://developers.refinitiv.com/content/dam/devportal/api-families/elektron/elektron-sdk-c/downloads/elektron-sdk-tutorials-source-code/ema-tutorials.zip

Since we are interested in downloading and decoding machine readable news we took the example #5 (MRNConsumer) and changed just one line according to our configuration

OmmConsumer consumer(OmmConsumerConfig().host("my.ip.goes.here:14002").username("my_user_goes_here"));

in the following code

int main( int argc, char* argv[] )
{ 
try { 
AppClient client;
// Create consumer and specify our connectivity parameters + user name
OmmConsumer consumer(OmmConsumerConfig().host("my.ip.goes.here:14002").username("my_user_goes_here"));
// Request NTA domain MRN_STORY type items 
consumer.registerClient(ReqMsg().serviceName("LDN_RSSL_DDS_CHE").name("MRN_STORY").domainType(MMT_NEWS_TEXT_ANALYTICS), client); // original
//consumer.registerClient(ReqMsg().serviceName("DIRECT_FEED").name("IBM.N").domainType(MMT_NEWS_TEXT_ANALYTICS), client); // original
// Sleep long enough to receive a few stories
sleep( 60000 );// API calls onRefreshMsg(), onUpdateMsg() and onStatusMsg()

} catch ( const OmmException& excp ) {
cout << excp << endl;
}
return 0;
}

PROBLEM

---------------

When we run MRNConsumer.exe we have the following error in output:

QUESTION

----------------

We'd like to download and decode machine readable news, what's wrong in our code?

Thanks in advance

elektronrefinitiv-realtimeelektron-sdk
image1.png (11.3 KiB)
image2.png (5.8 KiB)
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.

11 Answers

Upvotes
Accepted
4.4k 10 6 9

@mauro.medizza

Once you call consumer.registerClient(), EMA will create a new thread and start dispatching any message event to the callback using that new thread.

Your main thread is free to do whatever you want.

But in the example, it sleep the main thread in order to prevent it from leaving the main function.

int main( int argc, char* argv[] )
{ 
	try { 


		AppClient client;
		// Create consumer and specify our connectivity parameters + user name
		OmmConsumer consumer( OmmConsumerConfig().consumerName("Consumer_1").host( "192.168.27.46:14002" ).username( "API.TEST" ) );
		// Request NTA domain MRN_STORY type items 
		consumer.registerClient(ReqMsg().serviceName("ELEKTRON_DD").name("MRN_STORY").domainType(MMT_NEWS_TEXT_ANALYTICS), client);
		// Sleep long enough to receive a few stories
		sleep( 60000 );			// API calls onRefreshMsg(), onUpdateMsg() and onStatusMsg()
		
	} catch ( const OmmException& excp ) {
		cout << excp << endl;
	}
	return 0;
}

As you can see, once it sleep for 60 second, the main thread leave the main function and the application is terminated.

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.

Upvotes
23k 22 9 14

Hello @mauro.medizza,

From the error message, the service that you are requesting to subscribe MRN from is not available.

Is LDN_RSSL_DDS_CHE a valid service provided via EZD and permissioned to your site?

Suggest to try subscribing to ELEKTRON_DD, the default service for EZDs. If this service is also not available, as it is possible that you have a custom setup, please confirm with your TR account team (that licensed you for EZD) the correct permissioned service you should be using?

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.

Upvotes
20 1 3 4

Thank you for your fast reply. I changed the code this way as suggested:

consumer.registerClient(ReqMsg().serviceName("ELEKTRON_DD").name("IBM.N").interestAfterRefresh(false), client);

The result:

What's wrong?

Thanks


image3.png (2.9 KiB)
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.

Upvotes
23k 22 9 14

@mauro.medizza,

You are now subscribing to a valid service, permissioned to your user.

This error means you are not permissioned for item IBM.N from ELEKTRON_DD, that you are trying to subscribe to.

What item set have you purchased/are you permissioned for?

If it's MRN news, then RIC, or item, should be MRN_STORY. I do not think interestAfterRefresh = false can be right, as the nature of the news is to be continuously refreshing. Please refer to MRN tutorial for an example of MRN subscription request and response parsing.

If you are not sure what items you are permissioned for, please check with your TR account team.

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.

Upvotes
20 1 3 4

Maybe our contract doesn't allow us to see "IBM.N" data, so I changed again the source code:

consumer.registerClient(ReqMsg().serviceName("ELEKTRON_DD").name("GASI.MI").interestAfterRefresh(false), client);

Now I'm trying to get "GASI.MI". Another error:

REFRESH Item Name: GASI.MI

Service Name: ELEKTRON_DD

Item State: Non-streaming / Ok / None / 'All is well'

Wrong Domain and/or Payload 6 132

Any help please?


image4.png (19.0 KiB)
image4.png (19.0 KiB)
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.

Upvotes
20 1 3 4

Another test

consumer.registerClient(ReqMsg().serviceName("DIRECT_FEED").name("GASI.MI").domainType(MMT_NEWS_TEXT_ANALYTICS), client);

Still error:


image5.png (18.1 KiB)
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.

Upvote
4.4k 10 6 9

It is because the MRNConsumer example is made for MRN news only.

If you check the onRefreshMsg callback, you will see that it has if-else cause that confirm the payload and domain type is News Text Analytics.

void AppClient::onRefreshMsg( const RefreshMsg& refreshMsg, const OmmConsumerEvent& ) 
{
/***
***/
	// Confirm the payload and domain type and dump the metadata Fields to the console
	if (DataType::FieldListEnum == refreshMsg.getPayload().getDataType() && (MMT_NEWS_TEXT_ANALYTICS == refreshMsg.getDomainType()))
		decode(refreshMsg.getPayload().getFieldList());
	else
		cerr << endl << "Wrong Domain and/or Payload " << refreshMsg.getDomainType() << " " << refreshMsg.getPayload().getDataType() << endl;
}

Could you try using this request?

consumer.registerClient(ReqMsg().serviceName("ELEKTRON_DD").name("MRN_STORY").domainType(MMT_NEWS_TEXT_ANALYTICS), client);
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.

Upvotes
20 1 3 4

Hello Warat,

thanks you for helping, I change again the code as you suggested:

consumer.registerClient(ReqMsg().serviceName("ELEKTRON_DD").name("MRN_STORY").domainType(MMT_NEWS_TEXT_ANALYTICS), client);

now we are able to receive some data, but we receive data only for some seconds, after MRNConsumer.exe quits. Is it normal?

How to avoid this?


image6.png (23.6 KiB)
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.

Upvotes
20 1 3 4

Hello Warat, you are absolutly right!

it is enough to chnage, for instance

sleep(60000 * 60 * 8);

It works now!

Thanks a lot!

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.

Upvotes
20 1 3 4

By the way, I would have another question.

Now we use

consumer.registerClient(ReqMsg().serviceName("ELEKTRON_DD").name("MRN_STORY").domainType(MMT_NEWS_TEXT_ANALYTICS), client);

and it gives us all the news about everything, about every possible security.

Is it possible to specify in some ways the news only about some securities (maybe specifying RIC)?

I'm asking because our contract includes only 1000 Italian securities but we receive all the news about every existing securities all over the world.

Thanks in advance.

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.

No, I am afraid not.

The news you received depends on permission of the user you use. It is automatically handled by the server.

You will received all news story you are entitled to. And you have to filter the unwanted new out by yourself.

If you received news item you believe you are not entitled to, then it is either

  • Global news that every user receive
  • Your user is not setup properly
  • Or it is test user

You may verify this with your account manager.

Upvotes
20 1 3 4

Thanks again, Warat!

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