ChainStepByStepExample maven dependencies

Hi All,

I am trying to build the java project (doing ChainStepByStepExample). Can anybody please let me know the maven dependency required for com.thomsonreuters.platformservices.elektron

https://github.com/Refinitiv-API-Samples/Example.EMA.Java.ValueAddObjectsForEMA

Thanks

Dhruv

Best Answer

  • Modifications to ChainStepByStepExample to get it running with ERT:

    Additional library references:

    image

    Config for encrypted channel added for EmaConfig.xml in Consumers section:

    <Consumer>
                <Name value="Consumer_3"/>

                <!-- Channel set to "RSSL_ENCRYPTED"                                                        -->
                <Channel value="Channel_4"/>

                <!-- Dictionary is optional: defaulted to "ChannelDictionary"                                -->
                <Dictionary value="Dictionary_1"/>
        <!--        <Logger value="Logger_1"/>  -->
                <XmlTraceToStdout value="0"/>
            </Consumer>    

    In Channels:

    <Channel>
                <Name value="Channel_4"/>
                <ChannelType value="ChannelType::RSSL_ENCRYPTED"/>
                <CompressionType value="CompressionType::None"/>
                <GuaranteedOutputBuffers value="5000"/>
                <!-- EMA discovers a host and a port from EDP-RT service discovery for the specified location 
                     when both of them are not set and the session management is enable. -->
                <Location value="us-east"/>
                <EnableSessionManagement value="1"/>
                <CompressionThreshold value="300"/>  
                <!-- ObjectName is optional: defaulted to ""                                                -->
                <ObjectName value=""/>
            </Channel>

    Code changes:

    //    private static final String SERVICE_NAME = "ELEKTRON_EDGE";
        private static final String SERVICE_NAME = "ELEKTRON_DD";

    And later:

          try
            {
                OmmConsumerConfig config = EmaFactory.createOmmConsumerConfig()
                        .operationModel(operationModel);
                config.clientId(clientId);
               config.tunnelingKeyStoreFile(tunnelingKeyStoreFile);
               config.tunnelingSecurityProtocol("TLS");
               config.tunnelingKeyStorePasswd(tunnelingKeyStorePasswd);

                
                if(!DACS_USER_NAME.isEmpty())
                {
                    config.username(DACS_USER_NAME);
                }
                
    //            ommConsumer = EmaFactory.createOmmConsumer(config);
                ommConsumer = EmaFactory.createOmmConsumer(config.consumerName("Consumer_3").username(username).password(password));

    Does this help?





Answers

  • Hello @dhruv.arora,

    I can try to mention a way that I think will be most helpful to you, first. The example includes NetBeans project. After I have downloaded and imported the project into my NetBeans IDE.

    1. Repointed all Elektron SDK libraries included with the project already, with older versions, to my installed ESDK 1.5 versions of the same libraries:

    image 2. The only reference missing for me, turned out to be the last httpcore. That I added separately.

    There is also, in nbprojects/project.properties file, the list javac.classpath, that can be used as a starting point for maven, but if you have the latest ESDK, this will likely be outdated, you may need to update the versions.

    In my opinion, using the included project is the quickest and easiest starting point to get all the dependencies correctly.

  • Thanks Zoya. I have not been able to authenticate to the service. I am giving "GE-A-01444311-3-2480" as Host value in EmaConfig.xml. do you know, where to provide the password and client id? I am getting the following error:

    ERROR - Can't create the OmmConsumer because of the following error: login failed (timed out after waiting 45000 milliseconds) for GE-A-01444311-3-2480:14002)

    >>> Exiting the application

  • Hello @dhruv.arora,

    Your connectivity endpoint via machineId is ERT, via encrypted channel.

    The example call class ChainStepByStepExample, before parsing chain, actuates classic connectivity via classic RSSL channel. Which is where DACS_USER comes in.

    The example uses EmaConfig.xml included, with a single default consumer definition, that points into that infrastructure.

    So just passing creds will not help. Need to:

    • First connect via encrypted channel
    • And next, the chain requesting and parsing code can be reused.

    I can suggest quick modifications to ChainStepByStepExample to get it running with ERT. Quick replace, rather then a generic multi-infra-type-select example?

    Or you can use examples EMA 113 or 450 that came with ESDK to setup a channel and then merge the parsing code.

  • Thanks a lot Zoya.