question

Upvotes
Accepted
5 4 2 6

prevent trying to load EmaConfig.xml

Is it possible to prevent totally EMA to try reading the configuration file EmaConfig.xml completely ?

I am specifying the configuration from code using EmaFactory.createOmmConsumerConfig() and adding my own parameters.

However, the following are still showing in the logs, and they could be misinterpreted:

2017-01-16 11:11:48.422 INFO 33216 --- [ restartedMain] c.t.ema.access.OmmConsumerImpl : loggerMsg ClientName: EmaConfig Severity: Info Text: reading configuration file [EmaConfig.xml] from [D:\src\makoco] loggerMsgEnd

2017-01-16 11:11:48.422 ERROR 33216 --- [ restartedMain] c.t.ema.access.OmmConsumerImpl : loggerMsg ClientName: EmaConfig Severity: Error Text: Cannot locate configuration source EmaConfig.xml loggerMsgEnd

elektronrefinitiv-realtimeelektron-sdkema-apirrtelektron-message-apiconfiguration
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

Upvotes
Accepted
24.7k 54 17 14

Hi @GAUTHIER.ROEBROECK

Basically, the EMA Java is hard coded to look for the EMAConfig.xml file by default in the EmaConfigImpl.readConfiguration() function. This function is called every time the application calls the EmaFactory.createOmmConsumerConfig(); statement.

The source code is EmaConfigImpl.readConfiguration() in the <Elektron SDK java package>\Ema\Src\main\java\impl\com\thomsonreuters\ema\access\ folder as shown below:

You can modify the source code above to change the behavior, but I strongly suggest you test the application after code changed to verify if there are any unexpected errors.


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.

That's a shame that this configuration loading is hard coded.

Message sent to Brian Sandri and Iain Scott to ask them to add a comment if something can be done in the next releases.

Upvotes
17.2k 82 39 63

Hi @GAUTHIER.ROEBROECK

As indicated by Wasin, the current implementation of the libraries will always search for the EmaConfig.xml and log details if not found. If there is a concern regarding the misinterpretation of this log message, you do have the option to suppress the log details. Ema Java utilizes the Logger class so you can create your own log handler and intercept this message.

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
591 3 2 3

Hi,

A change to config file loading in EMA Java would be a useful addition to EMA. If this change was made as a pull request via GitHub we would certainly considering incorporating that into the EMA trunk for future releases.

Thanks

Iain

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
493 4 2 4

Both EMAJ and EMA C++ will always attempt to load the config file, however a config file is not required for either of them. The issue you are encountering with EMAJ is that the logging level for the config file messages is set to INFO, which ends up being displayed when running with default settings. In EMA C++, these are set to a lower log level so they are not output at the default logging level. We plan to change the log level in EMAJ to match how EMA C++ was set. This should result in the config related log messages you see going away unless you switch the log level from the default (INFO) to something less granular that would again include them.

For a quick workaround, and you don’t want to see the message, you can set logger level to higher level, see the below (assume you are using java.util.logging)

-Djava.util.logging.config.file=pathToLoggingConfig/logging.properties

Inside this logger configuration file, you can set logging level to Warning to override the default.

java.util.logging.ConsoleHandler.level=WARNING

Hope this helps!

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.

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.