question

Upvotes
Accepted
5 2 4 5

No rsslMsg in ReqMsg, NullpointerException thrown when registeriing client

Hi, we are connecting and getting market data ok, however we get repeated nullpointer exception after the service has been up for at least a day. Here we are getting snapshots every few minutes (ie. isSubscription=false). Restarting the service that talks to EMA fixes the problem.


ReqMsg reqMsg = EmaFactory.createReqMsg().serviceName(serviceName).name(assetCode).interestAfterRefresh(isSubscription);
reqMsg.payload(consumerClient.getMessageView());
consumerClient.setHandle(ommConsumer.registerClient(reqMsg, consumerClient));
The exception is thrown on the last line when registering the client because the ReqMsg has been created without a rsslMsg (or rather lost it's rsslMsg somehow).
ema-apirequestrssl
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.

@simon.dando

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

Hello @simon.dando

Does the problem still persist in your environment?

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,


AHS


Upvote
Accepted
24.7k 54 17 14

Hello @simon.dando

There is the RequestTimeout parameter that you can try to configure.

ema-requesttimeout.png

You can find more details regarding the EmaConfig.xml file and its parameters from the EMA Java Configuration Guide document. The document is available on the RTSDK Java Development and Configuration Guides with Examples page and in the RTSDK package.

Additionally, I noticed that you are using the Azul Open JDK. Please be informed that the RTSDK Java is supported and qualified with the following Java versions only.

  • Oracle Java SE 8 (JDK1.8)
  • Oracle Java SE 11 (JDK1.11)
  • Oracle Open JDK (1.8) -- Linux-only
  • Oracle Open JDK (1.11)

You can find more detail in the RTSDK Java Readme and API Compatibility Matrix files.

Please be informed that you can also submit the API issues to the Real-Time-SDK GitHub Issue page directly.


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 54 17 14

Hello @simon.dando

Can you give us more detail about your application?

  • The API/SDK version (RTSDK 2.0.3.L2/EMA 3.6.3, etc.) and edition (Java or C++)
  • Compiler and OS/Platform information
  • More Snippet code (getMessageView and setHandle methods, etc.)
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
25.3k 87 12 25

Hi @simon.dando

And can you also expand on the point 'Restarting the service that talks to EMA fixes the problem.' - what service is this - how does it talk to EMA?


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
5 2 4 5

Hi. We are using the Java 11 (Azul) API for EMA 3.6.2.2. Running in Linux. This is currently a microservice and makes its connection to EMA with the line:

ommConsumer = EmaFactory.createOmmConsumer(config);
public RefinitivOmmConsumerClient setHandle(long handle) {
    this.handle = handle;
    return this;
}
public ElementList getMessageView() {
    ElementList view = EmaFactory.createElementList();
    OmmArray array = EmaFactory.createOmmArray();
    array.fixedWidth(2);
    FIELDS.forEach((key, value) -> array.add(EmaFactory.createOmmArrayEntry().intValue(value)));
    view.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
    view.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, array));
    return view;
}
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 54 17 14

Hello @simon.dando

Thank you for the information. I have tested the given code with EMA API versions 3.6.3 and 3.6.2.G2 (3.6.2.2), I cannot replicate the issue. I got the "OmmArray to be encoded is empty." (when I have tried to create an empty list) or "Passed in payload is null" (when I have tried to set null to the payload) error messages instead. The example application does not throw an exception too.


I am noticed that you are using EMA version 3.6.2.2 (aka 3.6.2 G2 - RTSDK version 2.0.2 G2). It is the GitHub release ("G2") which is the development version and not recommended for production use. I recommend you test the issue with the latest full release version 3.6.3 L2 (Maven Central: 3.6.3.1).


Please see more detail regarding the RTSDK/EMA "L", "G", and "E" versions below

  • "L" releases (e.g., 1.2.0.L1) are full RTSDK releases that are uploaded to MyRefinitiv (formerly Customer Zone), Developer Community, and GitHub.
  • "G" releases (e.g., 1.2.0.G1) are releases that are only uploaded to GitHub.
  • "E" releases (E-Loads) are emergency RTSDK releases that are uploaded to MyRefinitiv and Developer Community but not to GitHub. Also note that emergency releases may only be partial (i.e., Java or C++/C 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
5 2 4 5

ok thanks Wasin. Let me try upgrading the lib.

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
5 2 4 5

Hi Wasin. I upgraded to use the dependency 3.6.3.1 and we are still seeing the problem after a few days. Testing has been quiet of late so I wonder if the lack of calls to Refinitiv is the problem and there is some kind of timeout happening killing rssl.

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
5 2 4 5

Hi Wasin. We upgraded the ema library to a non-dev version as suggested and everything had been ok over the last 6 weeks (give or take) but it has reared it's head again.

However we have seen this error just prior to it failing:

2022-02-12 22:20:15,972 [pool-5-thread-1] ERROR c.r.ema.access.OmmConsumerImpl - loggerMsg

ClientName: LoginCallbackClient

Severity: Error

Text: RDMLogin stream was closed with status message

username AQIC5wM2LY4Sfcztk96oBF4jUE6t%2BL8Z5uYqo%2Fg9Ax0HjR8%3D%40AAJTSQACMzAAAlNLABQtMTc0MjQ2MzYxNDc2ODg2OTk1NgACUzEAAjI0%23

usernameType 1

State: Closed/Suspect/Timeout - text: "TREP authentication token has expired."

loggerMsgEnd

The first google result suggested that the api should automatically take care of this.

We will now change to an officially support JDK and see if that makes a difference.

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 54 17 14

Hello @simon.dando

The State: Closed/Suspect/Timeout - text: "TREP authentication token has expired." status message means the RTO endpoint authentication token has expired, so it closed a connection.

The issue can occur if the EMA API does not receive a new token from the Refinitiv Data Platform (RDP) Gateway on time.

You can try to change the EMA TokenReissueRatio parameter value to adjust the length of time the OMMConsumer waits before retrieving a new access token and refreshing its connection to RTO. This parameter is available in the EmaConfig.xml file.

tokenreiissueration.png

Additionally, this is a new issue so it would be nice if you create a new post for this "TREP authentication token has expired" question.


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.

Thanks Wasin, but it still the same issue with the same error message.
Upvotes
5 2 4 5

Hi Wasin, we have waited a couple of weeks after adjusting the TokenReissueRatio as suggested above, to ensure that the adjustment had indeed fixed the issue. So setting it to 0.4 in EmaConfig.xml did seem to work, since all 4 upgraded instances had not had a problem in 2 weeks (would have expected to see it within a week), but then we noticed this in the logs (only for the very first quote request after reboot)

2022-03-28 12:18:08,912 [http-nio-8555-exec-2] ERROR c.r.ema.access.OmmConsumerImpl - loggerMsg

ClientName: EmaConfig

Severity: Error

Text: Unable to find tagId for TokenReissueRatio

loggerMsgEnd

Now I did add it to 3 places in EmaConfig.xml (was unable to upload so pls see below), but then we also see 3 error messages. Can you suggest where in the file it should be added please or has something changed on your side that may have fixed this issue?


    <IProviderList>        <IProvider>            <!-- Name is mandatory                                                                       -->            <Name value="Provider_1"/>            <!-- Server is optional: defaulted to "RSSL_SOCKET + 14002"                                  -->            <Server value="Server_1"/>            <!-- Directory is optional: defaulted to AdminControl::UserControlEnum                       -->            <!-- source directory configuration to use if OmmIProviderConfig::adminModel()               -->            <!-- was set to ApiControlEnum                                                               -->            <!-- this configuration also decides which dictionaries will be loaded at startup            -->            <!-- this configuration may be overwritten by OmmIProviderConfig::addAdminMsg()              -->            <Directory value="Directory_2"/>            <ItemCountHint value="10000"/>            <ServiceCountHint value="10000" />            <TokenReissueRatio value="0.4" />            <DispatchTimeoutApiThread value="500" />            <MaxDispatchCountApiThread value="500" />            <MaxDispatchCountUserThread value="500" />            <PipePort value="9009" />            <RefreshFirstRequired value="1" />        </IProvider>        <IProvider>            <!-- Name is mandatory                                                                       -->            <Name value="Provider_3"/>            <!-- Server is optional: now it specifies RSSL_WEBSOCKET connection options                  -->            <Server value="Server_2"/>            <!-- Directory is optional: defaulted to AdminControl::UserControlEnum                       -->            <!-- source directory configuration to use if OmmIProviderConfig::adminModel()               -->            <!-- was set to ApiControlEnum                                                               -->            <!-- this configuration also decides which dictionaries will be loaded at startup            -->            <!-- this configuration may be overwritten by OmmIProviderConfig::addAdminMsg()              -->            <Directory value="Directory_2"/>            <ItemCountHint value="10000"/>            <ServiceCountHint value="10000" />            <TokenReissueRatio value="0.4" />            <DispatchTimeoutApiThread value="500" />            <MaxDispatchCountApiThread value="500" />            <MaxDispatchCountUserThread value="500" />            <PipePort value="9009" />            <RefreshFirstRequired value="1" />        </IProvider>        <IProvider>            <!-- Name is mandatory                                                                       -->            <Name value="EncryptedProvider"/>            <!-- Server is optional: defaulted to "RSSL_SOCKET + 14002"                                  -->            <Server value="EncryptedServer"/>            <!-- Directory is optional: defaulted to AdminControl::UserControlEnum                       -->            <!-- source directory configuration to use if OmmIProviderConfig::adminModel()               -->            <!-- was set to ApiControlEnum                                                               -->            <!-- this configuration also decides which dictionaries will be loaded at startup            -->            <!-- this configuration may be overwritten by OmmIProviderConfig::addAdminMsg()              -->            <Directory value="Directory_2"/>            <ItemCountHint value="10000"/>            <ServiceCountHint value="10000" />            <TokenReissueRatio value="0.4" />


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 54 17 14

Hello @simon.dando

Please be informed that the TokenReissueRatio attribute belongs to the Consumer configuration node (<Consumer></Consumer>), not the IProvider configuration node (<IProvider></IProvider>).

Example:

<ConsumerGroup>
    <DefaultConsumer value="Consumer_4"/>
    <ConsumerList>
        <Consumer>
            <Name value="Consumer_4"/>
            <Channel value="Channel_4"/>
            <Dictionary value="Dictionary_1"/>
            <MaxDispatchCountApiThread value="6500"/>
            <MaxDispatchCountUserThread value="6500"/>
            <XmlTraceToStdout value="0"/>
            <TokenReissueRatio value="0.4"/>
        </Consumer>
    </ConsumerList>
</ConsumerGroup>

The "Text: Unable to find tagId for TokenReissueRatio" occurs when the application puts the Consumer group's configuration parameter in other groups (example IProvider, NiProvider, Dictionary, etc) configuration.

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.

Ha of course. Thanks.
Upvotes
5 2 4 5

Hi again Wasin. This morning we saw the same problem but with a slightly different error message: "Force Logout from DACS." The full message was:

2022-04-03 13:04:15,029 [pool-5-thread-1] ERROR c.r.ema.access.OmmConsumerImpl - loggerMsg

ClientName: LoginCallbackClient

Severity: Error

Text: RDMLogin stream was closed with status message

username AQIC5wM2LY4SfcyfWwLfwJmJabJym90F%2F3Y1eoqj30Mt2Ag%3D%40AAJTSQACMzAAAlNLABM1MDI2MDQxNDQ3NjAzNjUzNzkyAAJTMQACMjE%3D%23

usernameType 1

State: Closed/Suspect/Not entitled - text: "Force Logout from DACS."

loggerMsgEnd


Please note the only cfg change is the setting <TokenReissueRatio value="0.4"/> as discussed above.

Rebooting over the weekend is not a desirable solution for us.

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
5 2 4 5

... further to this, prior to this forced logout msg, this is the last approx time that we communicated with Refinitiv: (some 15 hours earlier)

2022-04-02 22:02:26,350 [pool-5-thread-1] INFO c.c.m.r.RefinitivOmmConsumerClient - StatusMsg

Please note we are meant to be going live with clients this weekend.

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 54 17 14

Hello @simon.dando

This is a new disconnection issue that is not related to the original question (no rsslMsg), so it would be nice if you create new posts for future questions.


The 'Force Logout from DACS.' error message is generated from the Refinitiv Real-Time server side. I highly recommend you contact the RTO support team directly via https://my.refinitiv.com/ website. The team can help you verify the server-side.

88197-rto-service-support.png

The status message "Closed / Suspect" on the Login stream indicates that the logins stream between the API and the server is closed. The closed login stream also closes all opened streams and the API will not recover the streams.

The application needs to re-create the OMMConsumer to re-open the login stream to reconnect to the server.




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
5 2 4 5

Hi Wasin, again it is, we still also see the null pointer when running rssl, but the cause is slightly different. So now with more context the title of this problem would be ''unstable connection after lulls in traffic''. We will probably just ensure we are requesting data every day of the week.

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 54 17 14

Hello @simon.dando

I understand your point. However, as the Q&A forum nature, we try to separate issues or questions to be multiple posts which can be beneficial for other developers who encounter the same error message ("TREP authentication token has expired." or "Force Logout from DACS. ", or etc.) as well.

If you want dedicated API support with SLA and a support ticket, you can contact your Refinitiv representative to apply for the RDC (Refinitiv Developer Connection) program.

Once your RDC registration is successful, you will see the "Contact premium support" button on the https://developers.refinitiv.com/en/api-catalog/refinitiv-real-time-opnsrc/rt-sdk-java page. You can click that button to submit the API support ticket to the API support team.

88197-rtsdk-contact-support.png

Please note that the "Force Logout from DACS. " needs to be investigated on the server-side, I highly recommend you contact the RTO support team directly via https://my.refinitiv.com/ website.

88197-rto-service-support.png


Hope this helps.


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
5 2 4 5

Thanks Wasin.

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.

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.