EMA Programmatic configuration in Java - unable to set Dictionary related elements
We're having trouble using EMA programmatic configuration in Java for the Dictionary related elements as part of a TRCC application
1) Using the example code we're able to connect to TRCC when specifying local RDMFieldDictionary & enumtype.def files (we can't get Channel method to work but not important right now) when using the an xml ema config file
2) Running the same code but programmatically setting the various parameters fails with the following:
Apr 22, 2020 2:43:55 PM com.thomsonreuters.ema.access.ConfigErrorTracker log
WARNING: loggerMsg
ClientName: EmaConfig
Severity: Warning
Text: no configuration exists in the config file for consumer dictionary [DictionaryGroup|DictionaryList]. Will use dictionary defaults if not config programmatically.
loggerMsgEndApr 22, 2020 2:43:55 PM com.thomsonreuters.ema.access.ConfigErrorTracker log
SEVERE: loggerMsg
ClientName: EmaConfig
Severity: Error
Text: no conversion in convertToEnum for enumType [FieldDictionary]
loggerMsgEndApr 22, 2020 2:43:57 PM com.thomsonreuters.ema.access.ChannelCallbackClient reactorChannelEventCallback
INFO: loggerMsg
ClientName: ChannelCallbackClient
Severity: Info
Text: Received ChannelUp event on channel Channel_1
Instance Name Consumer_1_1
Component Version eta3.1.1.L1.linux.rrg 64-bit Static
loggerMsgEndApr 22, 2020 2:44:42 PM com.thomsonreuters.ema.access.OmmConsumerImpl loadDictionary
SEVERE: loggerMsg
ClientName: Consumer_1_1
Severity: Error
Text: dictionary retrieval failed (timed out after waiting 45000 milliseconds) for
loggerMsgEnd
3) We're using the EMAJ_Config guide examples as our guide but are clearly missing something. Java code is as follows:
import com.thomsonreuters.ema.access.*;
import com.thomsonreuters.ema.rdm.EmaRdm;
import java.io.FileInputStream;
import java.io.InputStream;
import java.util.Properties;
public class EMATestContributor {
public static void main(String[] args) {
if (args.length < 1) {
System.out.println("Must provide config file name");
return;
}
try {
InputStream input = new FileInputStream(args[0]);
Properties prop = new Properties();
prop.load(input);
String hostAndPort = prop.getProperty("host_port");
String login = prop.getProperty("login");
String password = prop.getProperty("password");
String tunnel_name = prop.getProperty("tunnel_name");
String service_name = prop.getProperty("service_name");
String keystore_file_name = prop.getProperty("keystore_file");
String keystore_file_pwd = prop.getProperty("keystore_pwd");
String dictionaryFilePath = prop.getProperty("dictionary_file");
String enumFilePath = prop.getProperty("enum_file");
//String xmlConfigPath = prop.getProperty("xml_config");
System.out.println("Contributing to TR Contributions Channel");
AppClient appClient = new AppClient(login, password);
System.out.println("Starting encrypted connection...");
// Create an OMM consumer
Map innerMap = EmaFactory.createMap();
Map configMap = EmaFactory.createMap();
ElementList elementList = EmaFactory.createElementList();
ElementList innerElementList = EmaFactory.createElementList();
elementList.add(EmaFactory.createElementEntry().ascii("DefaultConsumer", "Consumer_1"));
innerElementList.add(EmaFactory.createElementEntry().ascii("Channel", "Channel_1"));
innerElementList.add(EmaFactory.createElementEntry().ascii("Dictionary", "Dictionary_1"));
innerMap.add(EmaFactory.createMapEntry().keyAscii( "Consumer_1", MapEntry.MapAction.ADD,
innerElementList));
innerElementList.clear();
elementList.add(EmaFactory.createElementEntry().map( "ConsumerList", innerMap ));
innerMap.clear();
configMap.add(EmaFactory.createMapEntry().keyAscii( "ConsumerGroup", MapEntry.MapAction.ADD,
elementList ));
elementList.clear();
String[] hp = hostAndPort.split(":");
innerElementList.add(EmaFactory.createElementEntry().ascii("ChannelType",
"ChannelType::RSSL_SOCKET"));
innerElementList.add(EmaFactory.createElementEntry().ascii("Host", hp[0]));
innerElementList.add(EmaFactory.createElementEntry().ascii("Port", hp[1]));
innerMap.add(EmaFactory.createMapEntry().keyAscii( "Channel_1", MapEntry.MapAction.ADD,
innerElementList));
innerElementList.clear();
elementList.add(EmaFactory.createElementEntry().map( "ChannelList", innerMap ));
innerMap.clear();
configMap.add(EmaFactory.createMapEntry().keyAscii( "ChannelGroup", MapEntry.MapAction.ADD,
elementList ));
elementList.clear();
innerElementList.add(EmaFactory.createElementEntry().ascii("DictionaryType",
"DictionaryType::FieldDictionary"));
innerElementList.add(EmaFactory.createElementEntry().ascii("RdmFieldDictionaryFileName", dictionaryFilePath));
innerElementList.add(EmaFactory.createElementEntry().ascii("EnumTypeDefFileName", enumFilePath));
innerMap.add(EmaFactory.createMapEntry().keyAscii( "Dictionary_1", MapEntry.MapAction.ADD,
innerElementList));
innerElementList.clear();
elementList.add(EmaFactory.createElementEntry().map( "DictionaryList", innerMap ));
configMap.add(EmaFactory.createMapEntry().keyAscii( "DictionaryGroup", MapEntry.MapAction.ADD,
elementList ));
elementList.clear();
OmmConsumer consumer = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig()
.config(configMap)
.tunnelingKeyStoreFile(keystore_file_name)
.tunnelingKeyStorePasswd(keystore_file_pwd)
);
ClassOfService cos = EmaFactory.createClassOfService().
authentication(EmaFactory.createCosAuthentication().type(CosAuthentication.CosAuthenticationType.NOT_REQUIRED))
.dataIntegrity(EmaFactory.createCosDataIntegrity().type(CosDataIntegrity.CosDataIntegrityType.RELIABLE))
.flowControl(EmaFactory.createCosFlowControl().type(CosFlowControl.CosFlowControlType.BIDIRECTIONAL).recvWindowSize(1200))
.guarantee(EmaFactory.createCosGuarantee().type(CosGuarantee.CosGuaranteeType.NONE));
System.out.println("Starting tunnel stream...");
// Create a request for a tunnel stream
TunnelStreamRequest tsr = EmaFactory.createTunnelStreamRequest()
.classOfService(cos)
.domainType(EmaRdm.MMT_SYSTEM)
.name(tunnel_name)
.serviceName(service_name);
// Send the request and register for events from tunnel stream
long tunnelStreamHandle = consumer.registerClient(tsr, appClient);
appClient.setOmmConsumer(consumer);
appClient.setTunnelHandle(tunnelStreamHandle);
Thread.sleep(60000);
} catch (Exception excp) {
System.out.println(excp.getMessage());
}
}
}
Best Answer
-
The DictionaryType must be "DictionaryType::FileDictionary" or "DictionaryType::ChannelDictionary".
If the application loads dictionary from local files, the value of DictionaryType must be DictionaryType::FileDictionary.
innerElementList.add(EmaFactory.createElementEntry().ascii("DictionaryType", "DictionaryType::FileDictionary"));
1
Answers
-
Thanks and apologies - two pairs of eyes missed that! Connected now though we still have a warning
Apr 23, 2020 8:15:03 AM com.thomsonreuters.ema.access.ConfigErrorTracker log
WARNING: loggerMsg
ClientName: EmaConfig
Severity: Warning
Text: no configuration exists in the config file for consumer dictionary [DictionaryGroup|DictionaryList]. Will use dictionary defaults if not config programmatically.
loggerMsgEndApr 23, 2020 8:15:08 AM com.thomsonreuters.ema.access.ChannelCallbackClient reactorChannelEventCallback
INFO: loggerMsg
ClientName: ChannelCallbackClient
Severity: Info
Text: Received ChannelUp event on channel Channel_1
Instance Name Consumer_1_1
Component Version eta3.1.1.L1.linux.rrg 64-bit Static
loggerMsgEndStarting tunnel stream...
----- Status message ----
StatusMsg
streamId="5"
domain="System Domain"
privateStream
state="Open / Ok / None / ''"
name="tunnelA"
serviceId="10"
serviceName="DDS_TRCE"
StatusMsgEndSending client login request...
----- Refresh message ----
RefreshMsg
streamId="5"
domain="System Domain"
solicited
RefreshComplete
privateStream
state="Open / Ok / None / 'Login accepted by host c170nctdpca06'"
itemGroup="00 00"
name="GE-A-00707661-3-2947"
serviceId="10"
Attrib dataType="ElementList"0 -
From the warning text, it makes sense because the application programmatically configures the DictionaryGroup and DictionaryList instead of using the configuration file.
0
Categories
- All Categories
- 6 AHS
- 37 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛