question

Upvotes
Accepted
53 2 4 6

Downloading a dictionary if needed

The RFAJ examples all load field and enum dictionaries from files through files on the local filesystem and calls like

FieldDictionary.readRDMFieldDictionary(dictionary, tempDictionary);

There is a single example omm/dictionary showing downloading and printing out a dictionary from the server.

There are in practice many dictionary updates and using dictionaries loaded from files is frequently problematic as messages which contain undefined fields generate errors. Is there a production quality example around showing how one should use dictionaries e.g. should one check the version on the server and if later than the file load?

treprfarfa-api
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
23k 22 9 14

Hello @alan.bain,

We use the dictionaries downloaded from the infrastructure (server, ADS) in the vast majority of the use cases, with very few exceptions.

We do not recommend the prior checking of the version of the dictionary loaded from the infrastructure, and then making the decision if to use it, based on the version.

The dictionary on the infra is the exact dictionary that is used to structure the data that the application is receiving. The dictionaries that are used to consume on the client app should be identical to the dictionaries used on the infra to publish, which will allow to avoid the parsing errors.

And yes, usually the dictionary on the infrastructure is one of the latest, or the latest, while the dictionary that was supplied with SDK is the dictionary that was current at the time of the SDK release and tends to be older. But regardless of this, the downloaded dictionary always matches. It can be neither older nor newer, can not be a subset of fids.

In RFA Java example Consumer from SDK, instead of trying to load dictionaries from files first, and only requesting from the infra failing that, just comment out loading from files check, and see sendDictionaryRequests(chnl) executed regardless, this is what a production app would do.

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
53 2 4 6

Can you point me at the example? The Quickstart consumer example only seems to load the dictionaries from files.

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
9.7k 49 38 60

hi @alan.bain,

Tutorial 10 - Downloading the Data Dictionaries within the RFAJ Tutorials section discusses loading the dictionary from the server.

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