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
REFINITIV
Question by Cornelia.Draculet · Jul 25, 2019 at 07:40 AM · elektron connect

Connection to EDP – host specification - authentication

Hello, I’m using example450__MarketPrice__QueryServiceDiscovery example for java connection code via EMA.

My user name is “GE-A-0110XXX-x-xxxx”.

(*) I wanted to set the host name in the OmmConsumerConfig but when the host is set the connection fails. Is this a normal behavior? We do not need to specify any host?

(*) Also, do we need to implement specific code in order to refresh the authentication token? I receive the warning log with the “Error text Failed to request authentication token with refresh token for user: GE-A-0110XXX-x-xxxx. Will try again with user name and password.” but the streaming continues. In your example “430_MarketPrice_TrepAuthentication » I saw a “consumer.reissue” instruction. Does “consumer.reissue” take care of refreshing the token? I tried to integrate the “reissue” code in my application but I have a crash at com.thomsonreuters.upa.valueadd.reactor.WlLoginHandler.validateReissue(WlLoginHandler.java:438) as this._loginRequest is null.

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.

7 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by umer.nalla · Jul 25, 2019 at 09:21 AM

Hi @Cornelia.Draculet

I just wish to confirm your understanding of the purpose of the example450. The technique demonstrated is typically used when you wish to use EDP Gateway for service discovery and not necessarily consume market data from EDP- is this the case here?

Can you confirm where in the config you are setting the host and what are you setting the host to? Also, any reason why you wish to override values that EMA session management is setting on your behalf?

With regards obtaining and refreshing tokens - this is carried out on your behalf by Elektron Message API.

Please refer to section 6.3.1 and section 6.6 of the EMA Java Dev Guide for further information on the above topics.

For a simpler ERT in Cloud example, you can refer to example113_MarketPrice_SessionManagement

Comment

People who like this

0 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
REFINITIV
Answer by Cornelia.Draculet · Jul 25, 2019 at 10:15 AM

Hi @Umer Nalla

Thanks for your answer.

In my application I need to consume market data from EDP.

I also used the sample example113_MarketPrice_SessionManagement in my implementation.

My sample code is as follow (in createProgramaticConfig I do not specify any host and any port for connection – I can send you all the code if need)

AppClient appClient = new AppClient();

OmmConsumer consumer = null;

OmmConsumerConfig config = EmaFactory.createOmmConsumerConfig().config(createProgramaticConfig());

config.tunnelingKeyStoreFile("C:/xxx/keystore/keystore.jks"); config.tunnelingKeyStorePasswd("mykeyXXXX");

config.clientId("xx..580..xx");

config.tunnelingSecurityProtocol("TLS");

-->>>>> this line //config.host("amer-3.pricing.streaming.edp.thomsonreuters.com:14002"); consumer = EmaFactory.createOmmConsumer(config.username("GE-A-0110XXX-x-xxxx").password("GE-XXXX"));

consumer.registerClient( EmaFactory.createReqMsg().serviceName("ELEKTRON_DD").name("IBM.N"), appClient);

Comment

People who like this

0 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
REFINITIV
Answer by umer.nalla · Jul 25, 2019 at 11:18 AM

Hi @Cornelia.Draculet

As detailed in the documentation, If you set the <Channel> parameter <EnableSessionManagement value="1"/> then EMA discovers a host and a port from EDP-RT service discovery for the specified Location - the default Location is 'us-east'.

If you want to set a specific host and port using programmatic config you can do so e.g..

...
...
configDb.add(EmaFactory.createMapEntry().keyAscii("ConsumerGroup", MapEntry.MapAction.ADD, elementList));
elementList.clear();
innerElementList.add(EmaFactory.createElementEntry().ascii("ChannelType", "ChannelType::RSSL_ENCRYPTED"));
innerElementList.add(EmaFactory.createElementEntry().ascii("Host", "amer-3.pricing.streaming.edp.thomsonreuters.com"));
innerElementList.add(EmaFactory.createElementEntry().ascii("Port", "14002"));
innerElementList.add(EmaFactory.createElementEntry().intValue("EnableSessionManagement", 1));
elementMap.add(EmaFactory.createMapEntry().keyAscii("Channel_1", MapEntry.MapAction.ADD, innerElementList));
innerElementList.clear();
...
...
Comment

People who like this

0 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
REFINITIV
Answer by Cornelia.Draculet · Jul 25, 2019 at 11:51 AM

Thanks @Umer Nalla,

In fact, in my createProgramaticConfig() function I didn’t set the host and port information, I wanted to add them after OmmConsumerConfig creation. It is just a detail, thanks a lot, it works very well with the new added parameters.

(*) Do you recommend to set the host and the port or to let EDP-RT service find it?

(*) How many connection for a RT server could we have for the same user (GE-A-xxx) ?

Comment

People who like this

0 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
REFINITIV
Answer by umer.nalla · Jul 25, 2019 at 12:03 PM

Hi @Cornelia.Draculet

Unless you have a good reason to connect to a specific server (e.g. advised to do so by your Refinitiv Account manager) it makes more sense to let EMA take care of it.
If you are connecting to a specific server then if that server has issues you could lose connectivity.

However, when I tried earlier to use the Location parameter with programmatic config, I could not connect. I could, however, connect when using a EMAConfig.xml file.

I am querying this with our development team - as this is not something I have tested previously and may well be doing something wrong!

Comment

People who like this

0 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
REFINITIV
Answer by umer.nalla · Jul 26, 2019 at 05:35 AM

Hi @Cornelia.Draculet

I raised this with our developer support team and they have confirmed the above behaviour I reported - i..e not being able to use Location with programmatic config - is because the EMA Defaulting behaviour is kicking in.

Because I was using Channel_1 in the programmatic config - but not specifying host + port, API is trying to use the default Host + port values from the default Channel_1 config.

To get round this you can change the Channel_1 name to something else in your programmatic config code.

e.g.

... 
innerElementList.add(EmaFactory.createElementEntry().ascii("Channel", "Channel_CD")); 
elementMap.add(EmaFactory.createMapEntry().keyAscii("Consumer_CD", MapEntry.MapAction.ADD, innerElementList)); 
innerElementList.clear(); 
elementList.add(EmaFactory.createElementEntry().map("ConsumerList", elementMap)); 
elementMap.clear(); configDb.add(EmaFactory.createMapEntry().keyAscii("ConsumerGroup", MapEntry.MapAction.ADD, elementList)); 
elementList.clear(); innerElementList.add(EmaFactory.createElementEntry().ascii("ChannelType", "ChannelType::RSSL_ENCRYPTED")); 
innerElementList.add(EmaFactory.createElementEntry().ascii("Location", "us-east")); 
innerElementList.add(EmaFactory.createElementEntry().intValue("EnableSessionManagement", 1)); 
elementMap.add(EmaFactory.createMapEntry().keyAscii("Channel_CD", MapEntry.MapAction.ADD, innerElementList)); 
innerElementList.clear(); 
... 

So, above I am using Channel_CD and Consumer_CD for the respective entry names

and then referring to the alternative Consumer entry when loading the config

consumer = EmaFactory.createOmmConsumer(config.consumerName("Consumer_CD").username(userName).password(password).config(configDb)); 

I did not need to change the Consumer name - but did so just to avoid any other potential default config clashes.

With the above code changes, I was successfully able to connect and consume data - without the need to specify a host.

Another minor point - if you are based in EMEA - you may prefer to use the 'eu-west' location rather than 'us-east'.

Comment

People who like this

0 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
REFINITIV
Answer by Pimchaya.Wongrukun · Jul 28, 2019 at 10:53 PM

Hello @Cornelia.Draculet

You do not need to specific code in order to refresh the authentication token. The API can perform this on behalf of you when EnableSessionManagement is 1 as shown in example450_MarketPrice_QueryServiceDiscovery.

ETAValueAdd layer in ESDK API refreshes the authentication token. ETAValueAdd requests a new authentication token with a refresh token every 4/5 of the expiration timeout; refresh token and the expiration timeout are in the token response received previously. If it fails to get authentication token, it will use username and password to request a new authentication token again and the application will receives “Error text Failed to request authentication token with refresh token for user: GE-A-0110XXX-x-xxxx. Will try again with user name and password.”. Once a new authentication token is received, EMA will reissue login with the new token to ADS to keep the connection alive. The refresh token and reissue login process is shown in the diagram below:

The streaming still continues after you receive the error text because

  • It is not the end of the expiration timeout yet (refreshing token is performed every 4/5 of the expiration timeout).
  • EMA reissues login with the new token requested with username and password to ADS before the end of the expiration timeout. Then, your application can continue getting data.

refrestoken-reissuelogin.png (35.0 KiB)
Comment

People who like this

0 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.

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 >
10 People are following this question.

Related Questions

EMA Java client errored to connect using Elektron Connect

Elektron Message API - Consumer Tutorial - Posting data to TR Contribution Channel

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • 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
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges