question

Upvotes
3 0 0 0

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-apirsslrequest
icon clock
10 |1500

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

Upvotes
11.5k 16 7 10

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 5.0 MiB each and 10.0 MiB total.

Upvotes
20.3k 73 10 20

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 5.0 MiB each and 10.0 MiB total.

Upvotes
3 0 0 0

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 5.0 MiB each and 10.0 MiB total.

Upvotes
11.5k 16 7 10

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 5.0 MiB each and 10.0 MiB total.

Upvotes
3 0 0 0

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 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea