question

Upvotes
Accepted
5 4 2 6

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)
);
elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apijava
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Monitored by @Wasin Waeosri

Hello @GAUTHIER.ROEBROECK

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question.

Thanks,

AHS

@GAUTHIER.ROEBROECK

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,

AHS

Upvote
Accepted
9.6k 10 7 7

Hello @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

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
9.6k 10 7 7

Hello @GAUTHIER.ROEBROECK

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


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Request timeout:

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

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

Upvotes
25.3k 87 12 25

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.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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.

Upvotes
9.6k 10 7 7

Hello @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>


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.