Dictionary usage in IProvider

michal_cabak
michal_cabak Newcomer
edited 4:53AM in EMA

we are writing Interactive Provider in java. We have questions about dictionary:

  1. Is ChannelDictionary applicable to the provider or only to the consumer?
    if it is applicable to the provider, how the config should work so that the dictionary will be downloaded by the provider from ADS?
  <DictionaryType value="DictionaryType::ChannelDictionary"/>

2. In version 3.7 DirectoryGroup/DirectoryList/Directory/Service/InfoFilter/DictionariesProvided was not needed and NO dictionary file is loaded at startup.
a) does it mean that no dictionary is used by such provider?


3. in latest version 3.9.0.1, DictionariesProvided is required. And it forces us to have Dictionary files available locally (see below our config) - otherwise provider will fail to start
a) is there a way to disable the mandate of dictionary presence?
b) what exactly is this dictionary used for by the provider?

<DirectoryGroup>
…
                        <DictionariesProvided>
                            <DictionariesProvidedEntry value=“ABC”/>
                        </DictionariesProvided>
…
</DirectoryGroup>
….
      <DictionaryGroup>
        <DictionaryList>
            <Dictionary>
                <Name value=“ABC”/>
                <DictionaryType value="DictionaryType::FileDictionary"/>
                <RdmFieldDictionaryFileName value="./RDMFieldDictionary"/>
                <EnumTypeDefFileName value="./enumtype.def"/>
            </Dictionary>
        </DictionaryList>
    </DictionaryGroup>

thanks

Michal

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @michal_cabak

    Thank you for reaching out to us.

    I tested it and found that the iprovider.series300.ex350_Dictionary_Streaming example demonstrate how to download data dictionary files from RTDS (ADH or ADS POP).

    Regarding the DictionariesProvided, you can call the adminControlDictionary method to handle the dictionary domain.

    provider = EmaFactory.createOmmProvider(EmaFactory.createOmmIProviderConfig().adminControlDictionary(OmmIProviderConfig.AdminControl.USER_CONTROL), appClient );
    

    The full example is in the ex332_Dictionary_UserControl.

  • michal_cabak
    michal_cabak Newcomer

    hello @Jirapongse , thanks for the reply.

    I have run your mentioned example (Dictionary_Streaming) from master. it fails to start (just like on my side) because it tries to load dictionary.

    Exception Type='OmmInvalidUsageException', Text='loggerMsg
        ClientName: DictionaryHandler
        Severity: Error
        Text:    DictionaryHandler.loadDictionaryFromFile() failed while initializing DictionaryHandler.
    	Unable to load RDMFieldDictionary file named ./RDMFieldDictionary
    	Error Text: Can't open file: ./RDMFieldDictionary
    	Instance Name EmaIProvider_1
    loggerMsgEnd
    
    ', Error Code='-1'
    	at com.refinitiv.ema.access.OmmServerBaseImpl.ommIUExcept(OmmServerBaseImpl.java:1053)
    	at com.refinitiv.ema.access.DictionaryHandler.loadDictionaryFromFile(DictionaryHandler.java:191)
    	at com.refinitiv.ema.access.DictionaryHandler.initialize(DictionaryHandler.java:130)
    	at com.refinitiv.ema.access.OmmServerBaseImpl.initialize(OmmServerBaseImpl.java:283)
    	at com.refinitiv.ema.access.OmmIProviderImpl.<init>(OmmIProviderImpl.java:77)
    	at com.refinitiv.ema.access.EmaFactory.createOmmProvider(EmaFactory.java:549)
    	at com.refinitiv.ema.examples.training.iprovider.series300.ex350_Dictionary_Streaming.IProvider.main(IProvider.java:199)
    
    

    only if I set below then IProvider starts successfully (probably it stops caring about dictionary entirely?)

    .adminControlDictionary(OmmIProviderConfig.AdminControl.USER_CONTROL)
    

    could you also reply to my original questions?

    1. Is ChannelDictionary applicable to the provider or only to the consumer?
    2. is the dictionary requirement changed between version 3.7 and 3.9?
    3. what exactly can be the usage of the dictionary at the provider side?
      1. I see it could be streamed back to the requestor (like in user control example)
      2. where else it is being used? does the framework validate the message submitted by the provider?

    thanks

    Michal

  • Jirapongse
    Jirapongse ✭✭✭✭✭
    1. I tested it and the ChannelDictionary configuration doesn't work with the IProvider.
    2. According to the error, yes, it changed.
    3. Dictionary is used to decode data. The data sent to the network only contains the field identifier and data. The dictionary is used to get its field name and data type. Both providers and consumers must use the same version of dictionary. The provider should be able to provide dictionary to consumers if consumers request for dictionary.