question

Upvotes
Accepted
1 0 1 0

We are getting 'OmmInvalidUsageException after updating our application with EMA library version Real-Time-SDK-1.5.1.L1

We were using ema SDK version 3.3.0 previously and are suggested to upgrade it to EMA version Real-Time-SDK-1.5.1.L1.java / ema SDK version 3.5.1. After upograding to the said library we are not able to connect to Reuter Elektron stream and are getting exception at the time of creating the consumer object. Below is the exception. Please let us know what is the issue.

2020-12-02 05:59:31,759 ERROR Thread-7 OmmConsumerImpl loggerMsg

ClientName: ChannelCallbackClient

Severity: Error

Text: Failed to add RsslChannel(s) to RsslReactor. Channel name(s)

Instance Name Consumer_3_1

RsslReactor @10dbddc6

RsslChannel null

Error Id -6

Internal sysError 0

Error Location Reactor.copyOAuthCredentialForSessionManagement

Error Text Failed to copy OAuth credential for enabling the session management; OAuth client ID does not exist.

loggerMsgEnd



Exception Type='OmmInvalidUsageException', Text='loggerMsg

ClientName: ChannelCallbackClient

Severity: Error

Text: Failed to add RsslChannel(s) to RsslReactor. Channel name(s)

Instance Name Consumer_3_1

RsslReactor @10dbddc6

RsslChannel null

Error Id -6

Internal sysError 0

Error Location Reactor.copyOAuthCredentialForSessionManagement

Error Text Failed to copy OAuth credential for enabling the session management; OAuth client ID does not exist.

loggerMsgEnd


', Error Code='-6'

at com.thomsonreuters.ema.access.OmmBaseImpl.ommIUExcept(OmmBaseImpl.java:1578)

at com.thomsonreuters.ema.access.ChannelCallbackClient.initializeReactor(ChannelCallbackClient.java:901)

at com.thomsonreuters.ema.access.ChannelCallbackClient.initializeConsumerRole(ChannelCallbackClient.java:973)

at com.thomsonreuters.ema.access.OmmConsumerImpl.handleAdminDomains(OmmConsumerImpl.java:446)

at com.thomsonreuters.ema.access.OmmBaseImpl.initialize(OmmBaseImpl.java:285)

at com.thomsonreuters.ema.access.OmmConsumerImpl.<init>(OmmConsumerImpl.java:43)

at com.thomsonreuters.ema.access.EmaFactory.createOmmConsumer(EmaFactory.java:237)

at com.integral.adaptor.RTRELEKTRON.comm.ETRON.ETRONSessionManager$CreateMktDataSession.run(ETRONSessionManager.java:357)

at java.lang.Thread.run(Thread.java:745)

refinitiv-realtimeelektronelektron-sdkema-apirrtelektron-message-api
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
Accepted
24.7k 64 15 21

Hi @sarthak.banerjee,

You will need a machine ID, associated password and a Client ID to get data from Refinitiv Realtime Optimized, formerly called Elektron Cloud.

Seems like you are not passing in the client ID parameter, or passing in an invalid Client ID. Please see this tutorial on how to create a Client ID for your application.

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

Hi @Gurpreet,

I have now generated the client ID from the below link for our application.

https://emea1.apps.cp.thomsonreuters.com/apps/AppkeyGenerator

I am passing userID, password and the generated clientID to connect as below.

consumer = EmaFactory.createOmmConsumer(config.consumerName(consumerName).username(userName).password(userPwd).clientId(clientId));

Now application is able to connect and getting rates. But I have received the below error message. Please let me know the implications of this error message and what needs to be done from our side to remove this error.

Note: Our application keep getting rates even after receiving this error message.

2020-12-03 04:29:20,068 WARN I/O dispatcher 1 loggerMsg

ClientName: ChannelCallbackClient

Severity: Warning

Text: Received Channel warning event on channel Channel_4

Instance Name Consumer_3_1

RsslReactor @21f12d69

RsslChannel @352410bd

Error Id 0

Internal sysError 0

Error Location null

Error text Failed to request authentication token with refresh token for user: GE-A-00336937-3-2529. Will try again with user name and password.

loggerMsgEnd

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.

Hi @sarthak.banerjee,

Does the application stop receiving updates after this error? Access token is refreshed every 5 minutes.

Can you please try to run the sample ema\examples\training\consumer\series400\ex450_MP_QueryServiceDiscovery and replicate this behavior?

I used the ServiceEndPointDiscovery api with dynamic emaconfig creation after getting the host and port information and then registering the client and consumer with takeExclusiveSignOnControl as true, I am able to connect and the said error exception is not coming. I am receiving rates as well. I have not used proxy information while registering for the service discovery.

serviceDiscovery.registerClient(EmaFactory.createServiceEndpointDiscoveryOption().username(userName).password(userPwd).clientId(clientId).transport(ServiceEndpointDiscoveryOption.TransportProtocol.TCP).takeExclusiveSignOnControl(takeExclusiveSignOnControl), endPointDiscoveryHandler);

consumer = EmaFactory.createOmmConsumer(config.consumerName(consumerName).username(userName).password(userPwd).clientId(clientId).takeExclusiveSignOnControl(takeExclusiveSignOnControl).config(configDb));

Upvotes
1 0 1 0

Hi @Gurpreet,

Can we get any documentation or list of error types/messages that we can receive via the status message on OmmConsumerClient.onStatusMsg() callback?

It will help us to equip our application with better error handlings.

Thanks.

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
24.7k 64 15 21

Hi @sarthak.banerjee,

I looked at your application error message again, and since you describe that it keeps on getting data - here is what is happening:

You have another application with the same credentials which is stealing the refresh token from this application. Both apps are fighting and using the password grant when the refresh grant fails. Please use credentials in one instance of the application only.

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

Hi @Gurpreet,

Previously I was using a different client id generated by Sunil. Now I generated a fresh clientId for my use and using it along with the same userId and password to connect.

Still I am getting the error. The error is coming only once approximately after 5 min of starting the application. But I am receiving the rates as usual even after getting that error.

I am using the same api from 3.5.1 library as I was using in lib version 3.3.0 previously. Only difference is I am passing the clientID parameter extra.

Should we continue to use the same api/data callback mechanism as we were doing with older library? Or do we have to handle it differently in this new library?

Please let us know.

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
24.7k 64 15 21

Not just client ID, you will need a new userID, password and a client ID, for your new application.

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

I used the ServiceEndPointDiscovery api with dynamic emaConfig creation after getting the host and port information and then registering the client and consumer with takeExclusiveSignOnControl as true, I am able to connect and the said error exception is not coming. I am receiving rates as well. I have not used proxy information while registering for the service discovery.

serviceDiscovery.registerClient(EmaFactory.createServiceEndpointDiscoveryOption().username(userName).password(userPwd).clientId(clientId).transport(ServiceEndpointDiscoveryOption.TransportProtocol.TCP).takeExclusiveSignOnControl(takeExclusiveSignOnControl), endPointDiscoveryHandler);

consumer = EmaFactory.createOmmConsumer(config.consumerName(consumerName).username(userName).password(userPwd).clientId(clientId).takeExclusiveSignOnControl(takeExclusiveSignOnControl).config(configDb));

Is this a safe way to have a better connection experience with the new library or something else has to be done?

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.

The example consumer\series100\ex113_MP_SessionMgmt shows all the steps which need to be done. Please refer to that sample.

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.