Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Elektron /
  • EMA /
avatar image
Question by Paul.Wuethrich2 · Apr 22, 2020 at 04:49 PM · elektronrefinitiv-realtimeelektron-sdkrrtema-apielektron-message-apijavaconfigurationelektron-data-dictionary

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());

}

}

}


People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Jirapongse · Apr 23, 2020 at 04:01 AM

@Paul.Wuethrich2

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"));
Comment
Paul.Wuethrich2

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Answer by Paul.Wuethrich2 · Apr 23, 2020 at 12:44 PM

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"
Comment

People who like this

0 Show 1 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
REFINITIV
Jirapongse ♦♦ · Apr 24, 2020 at 04:13 AM 0
Share

From the warning text, it makes sense because the application programmatically configures the DictionaryGroup and DictionaryList instead of using the configuration file.

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
11 People are following this question.

Related Questions

(JAVA) Does using interestAfterRefresh(false) remove the need for deregistering items with Elektron?

EMA NIP Dictionary request

How do I set GuaranteedOutputBuffer programatically?

EMA Java - Is it possible to open a stream in a paused state?

NullPointerException when printing FieldList content from update message to screen

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges