question

Upvotes
Accepted
3 0 0 3

Internal errors from com.refinitiv.ema.access.OmmInvalidUsageExceptionImpl

Hi

We are switching from RFA SSL to EMA RSSL. When we are interested in subset of market data FIDs, so we create views for reqMsgs and register to EMA client. equity reqMsgs and option reqMsgs use the same OMM Consumer instance but with different views (one view for equity and the other view for option). Could you please indicate under what kind of conditions that can caused the errors below happen? Here is the code:

ReqMsg reqMsg = EmaFactory.createReqMsg();
reqMsg.domainType(EmaRdm.MMT_MARKET_PRICE)
        .serviceName(service)
        .name(equityRic)
        .payload(equityFidView)
        .priority(1, 1)
        .initialImage(true)
        .interestAfterRefresh(true); 
    long handle = consumer.registerClient(reqMsg, client, emasub);
    emasub.getHandles().add(handle);

But when there are a lot of requests sent, we got these errors sometimes for some symbols, for examples:

com.refinitiv.ema.access.OmmInvalidUsageExceptionImpl: ReqMsgImpl.checkBatchView() failed to decode ElementEntry. Internal error INCOMPLETE_DATA
        at com.refinitiv.ema.access.MsgImpl.ommIUExcept(MsgImpl.java:393)
        at com.refinitiv.ema.access.ReqMsgImpl.checkBatchView(ReqMsgImpl.java:883)
        at com.refinitiv.ema.access.ReqMsgImpl.payload(ReqMsgImpl.java:645)


and

2024-09-12 16:55:17.979  INFO 45566 --- [Worker-SUB-6] c.o.d.p.s.p.r.e.Level1MarketDataProvider : Failed to subscribe to [MSFT--250620C00465000-Option-TopOfBook]

java.nio.BufferOverflowException: null
        at java.nio.Buffer.nextPutIndex(Buffer.java:525)
        at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:173)
        at com.refinitiv.ema.access.Utilities.copy(Utilities.java:275)
        at com.refinitiv.ema.access.MsgImpl.msgPayload(MsgImpl.java:787)
        at com.refinitiv.ema.access.ReqMsgImpl.payload(ReqMsgImpl.java:643)

and

2024-09-12 16:55:17.979  INFO 45566 --- [Worker-SUB-4] c.o.d.p.s.p.r.e.Level1MarketDataProvider : Failed to subscribe to [SEMR-Equity-TopOfBook]

java.lang.ArrayIndexOutOfBoundsException: -1
        at com.refinitiv.eta.codec.Encoders.encodeElementListComplete(Encoders.java:3296)
        at com.refinitiv.eta.codec.ElementListImpl.encodeComplete(ElementListImpl.java:40)
        at com.refinitiv.ema.access.ElementListImpl.encodedData(ElementListImpl.java:395)
        at com.refinitiv.ema.access.MsgImpl.msgPayload(MsgImpl.java:787)
        at com.refinitiv.ema.access.ReqMsgImpl.payload(ReqMsgImpl.java:643)
#technologyema-apijava
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
27.6k 67 18 14

Hello @fanghua.liu

I did a quick test by applying your request RIC code with the EMA Java ex360_MP_View example on the RTSDK 2.2.0.L1 (EMA 3.8.0.0).

consumer  = EmaFactory.createOmmConsumer(EmaFactory.createOmmConsumerConfig().host("localhost:14002").username("user"));
            
ElementList view = EmaFactory.createElementList();
OmmArray array = EmaFactory.createOmmArray();
            
array.fixedWidth(2);
array.add(EmaFactory.createOmmArrayEntry().intValue(22));
array.add(EmaFactory.createOmmArrayEntry().intValue(25));

view.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
view.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, array));
            
ReqMsg reqMsg = EmaFactory.createReqMsg();
reqMsg.domainType(EmaRdm.MMT_MARKET_PRICE)
    .serviceName("ELEKTRON_DD")
    .name("JPY=")
    .payload(view)
    .priority(1, 1)
    .initialImage(true)
    .interestAfterRefresh(true);

long handle = consumer.registerClient(reqMsg, appClient);

You RIC request code is valid. The code works fine on my environment.

1726196208229.png

Could you please give me more information about your application and code as follows?

  • The version of EMA Java
  • The version of Java SDK and your OS
  • snippet code that constructs the equityFidView Element List payload
  • Example RIC that encounters the problem

1726196208229.png (82.1 KiB)
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
3 0 0 3

Hi @wasin.w

EMA is 3.6.2.2

JDK: openjdk version "1.8.0_345"

public static ElementList createEquityView() {

OmmArray array = EmaFactory.createOmmArray();
Arrays.asList(ReutersFieldName.EQUITIES).forEach(field -> array.add(EmaFactory.createOmmArrayEntry().intValue(field.getFid())));
ElementList view = EmaFactory.createElementList();
view.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
view.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, array));

return view;
}

PHK and RETL got Internal error INCOMPLETE_DATA

SEMR got java.lang.ArrayIndexOutOfBoundsException: -1 error

MSFT--250620C00465000 got

ava.nio.BufferOverflowException: null

at java.nio.Buffer.nextPutIndex(Buffer.java:525)

at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:173)

at com.refinitiv.ema.access.Utilities.copy(Utilities.java:275)

at com.refinitiv.ema.access.MsgImpl.msgPayload(MsgImpl.java:787)

at com.refinitiv.ema.access.ReqMsgImpl.payload(ReqMsgImpl.java:643)



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
27.6k 67 18 14

Hello @fanghua.liu

Thank you for the information. I am not sure how you implemented your ReutersFieldName.EQUITIES variable, so I did a quick tested with the following code using EMA Java 3.6.2.2 and Java 1.8.0_261 connect to my local ADS.

ElementList view = EmaFactory.createElementList();

Integer fields[] = new Integer[] {  3, 22,25, 6,15,16,19,21,30,31,32};

Arrays.asList(fields).forEach(field -> array.add(EmaFactory.createOmmArrayEntry().intValue(field)));
view.add(EmaFactory.createElementEntry().uintValue(EmaRdm.ENAME_VIEW_TYPE, 1));
view.add(EmaFactory.createElementEntry().array(EmaRdm.ENAME_VIEW_DATA, array));
            
ReqMsg reqMsg = EmaFactory.createReqMsg();
reqMsg.domainType(EmaRdm.MMT_MARKET_PRICE)
    .serviceName("ELEKTRON_DD")
    .name("JPY=")
    .payload(view)
    .priority(1, 1)
    .initialImage(true)
    .interestAfterRefresh(true);

long handle = consumer.registerClient(reqMsg, appClient);

The code works fine on my end.

result.png

I also checked the RTSDK Java CHANGELOG.md file but I cannot find any related issue logs in the file.

If you can replicate the issue on demand on your control environment, could you please test the issue with the EMA Java 3.7.3.0 (RTSDK Java 2.1.3.L1) to see if the issue has been fixed in newer version of the SDK?

  • Note: The latest version of the SDK is EMA Java 3.8.0.0 (RTSDK Java 2.2.0.L1). However, this 3.8.0.0 version drops Java 8/1.8 supported.

Alternatively, you may contact the Real-Time APIs Support Team to investigate this null pointer issue in detail. You can submit a support ticket to the team by clicking the "Contact premium support" button on the https://developers.lseg.com/en/api-catalog/refinitiv-real-time-opnsrc/rt-sdk-java page.

rtsdk-contact-support.png



result.png (99.9 KiB)
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.