Read EMAconfig.xml from custom path

In the latest version, how to read EMAconfig.xml from custompath instead of current directory?

Best Answer

  • Hello @sagar.s

    In EMA Java, you can use EmaFactory.createOmmConsumerConfig(java.lang.String)
    to specify your custom path which EMAconfig.xml is in as explained in Elektron-SDK1.1.1.java.eload/Ema/Docs/refman/emajava/com/thomsonreuters/ema/access/EmaFactory.html
    shown below:

    image

    For example: To read EMAconfig.xml in the
    folder C:\myEMAProjects, an example snipped source code in EMA java
    application is:

    consumer  = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig("C:\\myEMAProjects").consumerName("Consumer_2"));

    EMA C++ also provides the same feature in OmmConsumerConfig(EmaString). An example snipped source code
    is:

    OmmConsumer consumer( OmmConsumerConfig("C:\\myEMAProjects").consumerName( "Consumer_2" ) );

    For the complete applications, please refer
    to

    EMA Java: example111__MarketPrice__UserSpecifiedFileConfig

    EMA C++: 111__MarketPrice__UserSpecifiedFileConfig