How can I retrieve service directory information from EMA?

Ripley79
Ripley79 Contributor

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.

Best Answer

  • umer.nalla
    umer.nalla LSEG
    Answer ✓

    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.

Answers