question

Upvotes
Accepted
488 16 20 29

How can I retrieve service directory information from EMA?

While EMA markets itself as being something easier to use, what if I'm interested in acquiring the list of services available within my ADS Server? For example, previously with the lower level APIs, RFA, UPA, etc, I was required to go through a basic sequence of steps where I connect, login, retrieve the directory of services and optionally retrieve the dictionary. Within this sequence, it was available to me to capture the list of services. However, EMA significantly reduces this code effort and all I need to do to request for data now is to perform the following method call:

consumer.registerClient( 
	ReqMsg().serviceName( "ELEKTRON" ).name( "AAPL.O" ),
	client );

In this situation, I am forced to know what service I want. What if I don't know and I want to dynamically choose which service? How do I do it?

thanks.

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apiService
icon clock
10 |1500

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

1 Answer

· Write an Answer
Upvotes
Accepted
25.3k 87 12 25

Hi @Ripley79

Please refer to the EMA example 331_Directory_Streaming which demonstrates how to make a Directory Request and process it.

That example registers a client for MMT_DIRECTORY but filters on a single service name

UInt64 dirHandle = consumer.registerClient( ReqMsg().domainType( MMT_DIRECTORY ).serviceName( "DIRECT_FEED" ), client, closure );

However, by removing the optional serviceName() filter, you can receive the complete Directory

UInt64 dirHandle = consumer.registerClient( ReqMsg().domainType( MMT_DIRECTORY ), client, closure );

The Decode methods in the AppClient show you how to decode the payload and extract the list of Services. Please the EMA_RDMUsageGuide.pdf for full details

Example output from the 331 example once I remove the ServiceName filter :

ID: ☺ Action: 2 DataType: ElementList Value: Name: Name DataType: Ascii Value: ELEKTRON_EDGE
Name: Vendor DataType: Ascii Value: Reuters
Name: Capabilities DataType: OmmArray Value:
Name: DictionariesProvided DataType: OmmArray Value:
Name: DictionariesUsed DataType: OmmArray Value:
Name: QoS DataType: OmmArray Value:
ID: ☻ Action: 2 DataType: ElementList Value: Name: ServiceState DataType: UInt Value: 1
ID: ♦ Action: 2 DataType: ElementList Value: Name: OpenLimit DataType: UInt Value: 10000
ID: ☺ Action: 2 DataType: ElementList Value: Name: Name DataType: Ascii Value: ELEKTRON_DD
Name: Vendor DataType: Ascii Value: Reuters
Name: Capabilities DataType: OmmArray Value:
Name: DictionariesProvided DataType: OmmArray Value:
Name: DictionariesUsed DataType: OmmArray Value:
Name: QoS DataType: OmmArray Value:
ID: ☻ Action: 2 DataType: ElementList Value: Name: ServiceState DataType: UInt Value: 1
ID: ♦ Action: 2 DataType: ElementList Value: Name: OpenLimit DataType: UInt Value: 10000

In the above example my server provides two Services ELEKTRON_DD and ELEKTRON_EDGE

Note, however, that just picking a service from the Service Directory and then using that to consume data is not guaranteed to give you the expected results - as you have no way of knowing which service provides the data source you are expecting to consume from. If you are connecting to an ADS server on your site, the ADS could well be providing multiple services, including both internal and external vendor data. In addition to that, the server may be providing delayed or conflated data - which may not be suitable for your client application. Finally, you may also not be permissioned on Dacs to consume data from a given service.

Therefore, whilst requesting a Service Directory can be useful for confirming if the service you require is up and running, you should be checking with your Market Data team in the first instance to ascertain the correct service that provides the data you are expecting to consume. Once your Market Data team confirms the service name, it would be highly surprising if they changed the name of the service without informing all internal users in advance.

icon clock
10 |1500

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

Is there a way to have only the services for which the account is able to access ?

This new EMA API is better than RFA, but it is still lacking basic function to retrieve list of accessible services without 150 lines of code to parse the message :(

@GAUTHIER.ROEBROECK

When we verify with EMA developer guide, "The Directory request calls for all services and filters", so no. In the application, I would keep the service or the list of services that are of interest to the specific application, and from the list of services returned by the directory request, only process the responses for those services, while ignoring the rest.

that was my thought, the API and the whole platform is bloated.

I have run same example with the removal of serviceName filter, I always get following error.

loggerMsg

TimeStamp: 08:53:04.822 ClientName: DirectoryCallbackClient Severity: Error Text: Internal error: failed to encode RsslRDMDirectoryMsg in DirectoryCallbackClient::processCallback() RsslChannel 0x0000000000000000 Error Id -21 Internal sysError 0 Error Location RDM\rsslRDMDirectoryMsg.c:417 Error Text (ret = rsslEncodeElementEntryInit(pEncodeIter, &elementEntry, 0)) == RSSL_RET_SUCCESS

loggerMsgEnd

What could be the issue? The original example with serverName runs fine. Thanks.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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