Hello @rkumar
Please try the following steps:
1.Copy enumtype.def and RDMFieldDictionary in asiaCannedData folder to [ESDK_ROOT]\ Java\Ema\Examples\src\main\java
2.Copy EmaConfig.xml in [ESDK_ROOT]\Java\Ema\Examples\src\main\etc to [ESDK_ROOT]\ Java\Ema\Examples\src\main\java . In the java folder, you should see like this:
3. In EmaConfig.xml from step 2(in java folder), change Dictionary_1 to be Dictionary_2 then save the file.
The Consumer_1 used by the application should be like this:
<Consumer> ... <Name value="Consumer_1"/> ... <Dictionary value="Dictionary_2"/> ...</Consumer>
4.Open [ESDK_ROOT]\Java\Ema\Examples\src\main\java\com\thomsonreuters\ema\examples\training\consumer\series100\example100__MarketPrice__Streaming\Consumer.java to use a RIC provided in Canned data by replacing IBM.N to a new one e.g. JPY=A and save the file.
consumer.registerClient(reqMsg.serviceName("DIRECT_FEED").name("JPY=A"), appClient);
5. Open cmd and go to [ESDK_ROOT]\Java\Ema\Examples\src\main\java to set the classpath. For example: if ESDK_ROOT is C:\Elektron-SDK1.2.2.java.rrg, the classpath is:
setCLASSPATH=C:\Elektron-SDK1.2.2.java.rrg\Java\Ema\Libs\ema-3.2.2.0.jar;C:\Elektron-SDK1.2.2.java.rrg\Java\Eta\Libs\upa-3.2.2.0.jar;C:\Elektron-SDK1.2.2.java.rrg\Java\Eta\Libs\upaValueAdd-3.2.2.0.jar;C:\Elektron-SDK1.2.2.java.rrg\Elektron-SDK-BinaryPack\Java\Eta\Libs\jdacsUpalib.jar;C:\Elektron-SDK1.2.2.java.rrg\Elektron-SDK-BinaryPack\Java\Ema\Libs\apache\commons-collections-3.2.2.jar;C:\Elektron-SDK1.2.2.java.rrg\Elektron-SDK-BinaryPack\Java\Ema\Libs\apache\commons-configuration-1.10.jar;C:\Elektron-SDK1.2.2.java.rrg\Elektron-SDK-BinaryPack\Java\Ema\Libs\apache\commons-lang-2.6.jar;C:\Elektron-SDK1.2.2.java.rrg\Elektron-SDK-BinaryPack\Java\Ema\Libs\apache\commons-logging-1.2.jar;C:\Elektron-SDK1.2.2.java.rrg\Elektron-SDK-BinaryPack\Java\Ema\Libs\SLF4J\slf4j-1.7.12\slf4j-api-1.7.12.jar;C:\Elektron-SDK1.2.2.java.rrg\Elektron-SDK-BinaryPack\Java\Ema\Libs\SLF4J\slf4j-1.7.12\slf4j-jdk14-1.7.12.jar;C:\Elektron-SDK1.2.2.java.rrg\Elektron-SDK-BinaryPack\Java\Ema\Libs\xpp3-1.1.4c.jar;.
6. Compile the application at [ESDK_ROOT]\Java\Ema\Examples\src\main\java. For example:
javac C:\Elektron-SDK1.2.2.java.rrg\Java\Ema\Examples\src\main\java\com\thomsonreuters\ema\examples\training\consumer\series100\example100__MarketPrice__Streaming\*.java
7. Run the application at [ESDK_ROOT]\Java\Ema\Examples\src\main\java:
java com.thomsonreuters.ema.examples.training.consumer.series100.example100__MarketPrice__Streaming.Consumer
The figure showing step 5 to 7:
Have you done step 6 CONFIGURE CONSUMER FOR LOCAL DATA DICTIONARY in asiaCannedData/readme.html yet?
By default, EMA application loads dictionary from the server. Unfortunately, The sink_driven_src tool does not support dictionary download, so it does not send the dictionary back when EMA application requests the dictionary. Therefore before running the application, you need to configure the application to use the data dictionary files provided with the Elektron Test Data package. This will ensure that the consumer is using a data dictionary compatible with the captured data. For the step to do this, please refer to section 6.1 CONFIGURING EMA TO USE LOCAL DATA DICTIONARY FILES. in asiaCannedData/readme.html
Hope this help.
When I did not do step 6, I got the similar error as yours:
After I follow the steps in section 6.1 of asiaCannedData/readme.html. The error did not occur.
Moreover, please check the application source code if it requests the RIC which canned data contains(listed in section 7). Otherwise, the application will get a state of the RIC like “state="Closed / Suspect / None / 'No data in cache.'" as shown below:
Hi @rkumar
Are you sure the working directory is the src\main\etc directory?
The working directory will be dictated how you are running the application. e.g. for me my working directory (based on my environment and Java IDE) is - <ESDKroot>\Java\Ema\Examples
So, for me I place the EmaConfig,xml and dictionary files in the above folder when I run my application and I want to use local dictionary files, with the following EmaConfig.xml entries for Dictionary_2
<Name value="Dictionary_2"/> <DictionaryType value="DictionaryType::FileDictionary"/> <RdmFieldDictionaryFileName value="./RDMFieldDictionary"/> <EnumTypeDefFileName value="./enumtype.def"/></Dictionary>
In terms of using the correct RIC code, this is noted on the QuickStart page where it refers to the call to registerClient e.g.
consumer.registerClient( ReqMsg().serviceName( "ELEKTRON" ).name( "VOD.L" ), client );
You need to make sure the RIC code (VOD.L above) is one of the ones mentioned in section 7 of the asiaCanned.html file i.e. you need to make sure you are actually requesting an instrument for which data exists in the captured data file.
If the above talk of registerClient does not mean anything to you, then I recommend you read through the basic EMA Java tutorials.
@pimchaya.wongrukun01 Thanks alot it worked !!.
i was actually trying to implement a case where i could get real time bid and ask values for currencies . so can you please tell me where i could get RIC for all currencies and how could i get there real time values with timestamp. i want to keep my query as simple as possible just to filter and get as much info i need.