1. Using EMA as gradle dependency
implementation group: 'com.refinitiv.ema', name: 'ema', version: '3.6.6.0'
Java 17, Windows 10
2. I used example from https://developers.refinitiv.com/en/api-catalog/refinitiv-real-time-opnsrc/rt-sdk-java/tutorials#ema-consumer-posting-data-to-contribution-channel
Stuck on Establish an encrypted connection to the server step. Keep getting error:
Error text Tunnel Channel Closed
Here is my EmaConfig.xml
<?xml version="1.0" encoding="UTF-8"?>
<EmaConfig>
<ConsumerGroup>
<!-- DefaultConsumer parameter defines which consumer configuration is used by OmmConsumer-->
<!-- if application does not specify it through OmmConsumerConfig::consumerName()-->
<!-- first consumer on the ConsumerList is a default consumer if this parameter is not specified-->
<DefaultConsumer value="Consumer_1"/>
<ConsumerList>
<Consumer>
<Name value="Consumer_1"/>
<!-- Channel is optional: defaulted to "RSSL_SOCKET + localhost + 14002" -->
<Channel value="Channel_1"/>
<!-- Logger is optional: defaulted to "File + Success" -->
<Logger value="Logger_2"/>
<!-- Dictionary is optional: defaulted to "ChannelDictionary" -->
<Dictionary value="Dictionary_2"/>
<XmlTraceToFile value="1"/>
</Consumer>
</ConsumerList>
</ConsumerGroup>
<ChannelGroup>
<ChannelList>
<Channel>
<Name value="Channel_1"/>
<ChannelType value="ChannelType::RSSL_ENCRYPTED"/>
<!-- CompressionType is optional: defaulted to None -->
<!-- possible values: None, ZLib, LZ4 -->
<CompressionType value="CompressionType::None"/>
<GuaranteedOutputBuffers value="5000"/>
<Host value="contrib1-emea1.uat.platform.refinitiv.com"/>
<Port value="443"/>
</Channel>
</ChannelList>
</ChannelGroup>
<DictionaryGroup>
<DictionaryList>
<Dictionary>
<Name value="Dictionary_1"/>
<!-- DictionaryType is optional: defaulted to ChannelDictionary" -->
<!-- possible values: FileDictionary, ChannelDictionary -->
<!-- if DictionaryType is set to ChannelDictionary, file names are ignored -->
<DictionaryType value="DictionaryType::ChannelDictionary"/>
</Dictionary>
<Dictionary>
<Name value="Dictionary_2"/>
<DictionaryType value="DictionaryType::FileDictionary"/>
<!-- dictionary names are optional: defaulted to RDMFieldDictionary and enumtype.def -->
<RdmFieldDictionaryFileName value="./RDMFieldDictionary"/>
<EnumTypeDefFileName value="./enumtype.def"/>
</Dictionary>
</DictionaryList>
</DictionaryGroup>
</EmaConfig>
Here is my source code:
public class ContributorTest {
public static void main(String[] args) {
try {
System.setProperty("java.util.logging.config.file", "src/main/resources/logging.properties");
System.out.println("Contributing to Refinitiv Contributions Channel");
System.out.println("Starting encrypted connection...");
// Create an OMM consumer
OmmConsumer consumer = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig()); <------ error here
.....
} catch (Exception excp) {
System.out.println(excp.getMessage());
}
}
}
I followed pre-requirements:
- copied the RDMFieldDictionary and enumtype.def from EMA /etc directory.
- added the Comodo certificate authority to the keystore (the default Certificate Authority Keystore location in the Java directory)
Here is output logs:
Contributing to Refinitiv Contributions Channel
Starting encrypted connection...
2022-09-28 16:16:19.996 WARNING com.refinitiv.ema.access.ChannelCallbackClient reactorChannelEventCallback
loggerMsg
ClientName: ChannelCallbackClient
Severity: Warning
Text: Received ChannelDownReconnecting event on channel Channel_1
RsslReactor @58ce9668
RsslChannel @172b013
Error Id 0
Internal sysError 0
Error Location null
Error text Tunnel Channel Closed
loggerMsgEnd