Change default EMA timeout programmatically ?

it seems the default timeout for EMA Java is 45000 milliseconds, is it possible to change that programmatically?

I did not find anything in OmmConsumerConfig about that.

I am not using EmaConfig.xml and i am creating my OmmConsumer like that:

OmmConsumerConfig config = EmaFactory.createOmmConsumerConfig();
consumer = EmaFactory.createOmmConsumer(config
.host(host)
.username(username)
.applicationId(applicationId)
);

Best Answer

  • GAUTHIER.ROEBROECK

    Unfortunately, EMA Java does not support setting timeout programmatically; you have to set the timeout in EmaConfig.xml. Anyway, EMA Java is open source. Hence, you can modify EMA Java source code to be able to set timeout programmatically. EMA Java source code can be found in <EMA package>\Ema\Src\main

Answers

  • GAUTHIER.ROEBROECK

    You can set timeout for login, dictionary, directory and item request in EMA as shown below:

    image

    image

  • Request timeout:

    image

    For more detail, please refer to <Elektron package>\Ema\Docs\EMAJ_ConfigGuide.pdf

  • Hi,

    You do not state which timeout you refer to - so I am going to guess the Login Timeout?

    If this is the case, please refer to the EMAJ_ConfigGuide.pdf that can be found in the EMA\Docs folder when you unpack the Elektron SDK.

    You will note there is a parameter LoginRequestTimeOut which defaults to 45,000 milliseconds - which you can amend. There are other timeout values too such as the Dictionary Request / Directory Request - both of which also default to 45,000ms

    You can change these by amending the EMAConfig.xml file.

  • GAUTHIER.ROEBROECK

    The example of setting timeout for dictionary, directory, login, item request in EmaConfig.xml:

    <Consumer>
    <Name value="Consumer_1"/>
    <Channel value="Channel_1"/>
    <Dictionary value="Dictionary_1"/>

    <!-- set dictionary, directory, login and request timeout to be 60 second-->
    <DictionaryRequestTimeOut value="60000"/>
    <DirectoryRequestTimeOut value="60000"/>
    <LoginRequestTimeOut value="60000"/>
    <RequestTimeout value="60000"/>


    </Consumer>


  • thanks, but i am actually trying to set the timeout programmatically

  • I would like the program to fail early in case of issue, so all the timeouts related to initialization, so i suppose login and dictionnary.

  • thanks, but i am actually trying to set the timeout programmatically