question

Upvotes
Accepted
1 0 1 1

why dictionary retrieval failed

When debugging the code at night in China time, the following error was reported. Why?

elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-api
20210104215057.jpg (430.5 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
Accepted
38.1k 71 35 53

@guchao691

I can replicate this issue when using ChannelType::RSSL_ENCRYPTED.

Exception in thread "main" java.lang.ClassCastException: com.refinitiv.ema.access.EncryptedChannelConfig cannot be cast to com.refinitiv.ema.access.SocketChannelConfig
    at com.refinitiv.ema.access.OmmConsumerImpl.loadDictionary(OmmConsumerImpl.java:385)
    at com.refinitiv.ema.access.OmmConsumerImpl.handleAdminDomains(OmmConsumerImpl.java:450)
    at com.refinitiv.ema.access.OmmBaseImpl.initialize(OmmBaseImpl.java:285)
    at com.refinitiv.ema.access.OmmConsumerImpl.<init>(OmmConsumerImpl.java:43)
    at com.refinitiv.ema.access.EmaFactory.createOmmConsumer(EmaFactory.java:237)
    at com.refinitiv.ema.examples.training.consumer.series100.ex100_MP_Streaming.Consumer.main(Consumer.java:57)

It looks like to be a problem in the API. According to the class hierarchy, EncryptedChannelConfig can't be cast to SocketChannelConfig.

You can report this issue via GitHub.

For the workaround:

1. You can load the data dictionary from the local files instead.

<Dictionary>
            <Name value="Dictionary_2"/>
            <DictionaryType value="DictionaryType::FileDictionary"/>

            <!-- dictionary names are optional: defaulted to RDMFieldDictionary and enumtype.def -->
            <RdmFieldDictionaryFileName value="./RDMFieldDictionary"/>
            <EnumTypeDefFileName value="./enumtype.def"/>
        </Dictionary>

2. Or, you can increase the value of DictionaryRequestTimeOut configuration under the Consumer.

    <ConsumerList>
        <Consumer>
            <!-- Name is mandatory                                                                        -->
            <Name value="Consumer_1"/>
            <DictionaryRequestTimeOut value="0"/>

1609827079468.png (8.6 KiB)
1609827333721.png (107.7 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.

thanks.

If the local data dictionary is used, will there be updates in the future, and will it be necessary to synchronize updates from the server at a fixed time?

The data dictionary files are updated regularly. You can download them from Software Downloads. It is in the MDS - General product family and TREP Template Service Pack product.

Typically, you can update the data dictionary files when:

1. There are newly added fields and you want to get data from those fields.

2. Or, the application reports the following error:

value: OmmError
      ErrorCode="FieldIdNotFound"
OmmErrorEnd
1609830907448.png (34.7 KiB)

Can you provide the download address of the dictionary?

If our application uses a local dictionary, but you update the dictionary after a period of time, but our application is not updated, will there be parsing errors?

Show more comments
Upvotes
11.5k 16 7 10

Hello @guchao691

Does the problem occur when you test at other times? Does the application download Dictionary from Real-Time provider or from the local file? You can check the <DictionaryType> node in EmaConfig.xml configuration file:

  • <DictionaryType value="DictionaryType::ChannelDictionary"/>: API downloads Dictionary information from Real-Time provider
  • <DictionaryType value="DictionaryType::FileDictionary"/>: API downloads Dictionary information from local files (<RdmFieldDictionaryFileName> and <EnumTypeDefFileName> nodes). If you are using this configuration, are those <RdmFieldDictionaryFileName> and <EnumTypeDefFileName> nodes point to the correct files path?

Can you replicate the issue on demand? If so, please enable the XML trace, replicate the issue and share the XML trace file. You can see how to enable the XML trace in "XML Trace" section of this EMA Configuration Overview article.

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.

hello @wasin.waeosri

If it is not for US stock trading hours, it can be obtained normally.

Check that the configuration file is “<DictionaryType value="DictionaryType::ChannelDictionary"/>”


Click below to post an Idea Post Idea