Have created server side solution using EMA API for fetching prices. The service gets stalled after

The issue is not reproducable, occuring intermittently. The program gets halted and requires restart of full application.

Getting below Exception:

2017-06-07T11:58:10.217+05:30 [APP/0] [ERR] Exception in thread "pool-2-thread-1" java.lang.NullPointerException 2017-06-07T11:58:10.218+05:30 [APP/0] [ERR] at com.thomsonreuters.ema.access.SingleItem.remove(Unknown Source) 2017-06-07T11:58:10.218+05:30 [APP/0] [ERR] at com.thomsonreuters.ema.access.ItemCallbackClient.defaultMsgCallback(Unknown Source) 2017-06-07T11:58:10.218+05:30 [APP/0] [ERR] at com.thomsonreuters.ema.access.ItemCallbackClient.processRefreshMsg(Unknown Source) 2017-06-07T11:58:10.218+05:30 [APP/0] [ERR] at com.thomsonreuters.upa.valueadd.reactor.Reactor.sendDefaultMsgCallback(Reactor.java:808) 2017-06-07T11:58:10.218+05:30 [APP/0] [ERR] at com.thomsonreuters.upa.valueadd.reactor.Reactor.sendAndHandleDefaultMsgCallback(Reactor.java:823) 2017-06-07T11:58:10.219+05:30 [APP/0] [ERR] at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.callbackUser(WlItemHandler.java:2663) 2017-06-07T11:58:10.219+05:30 [APP/0] [ERR] at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.readMsg(WlItemHandler.java:1704) 2017-06-07T11:58:10.219+05:30 [APP/0] [ERR] at com.thomsonreuters.upa.valueadd.reactor.WlItemHandler.readRefreshMsg(WlItemHandler.java:1950) 2017-06-07T11:58:10.219+05:30 [APP/0] [ERR] at com.thomsonreuters.upa.valueadd.reactor.Watchlist.readMsg(Watchlist.java:277) 2017-06-07T11:58:10.219+05:30 [APP/0] [ERR] at com.thomsonreuters.upa.valueadd.reactor.Reactor.dispatchAll(Reactor.java:3217) 2017-06-07T11:58:10.219+05:30 [APP/0] [ERR] at com.thomsonreuters.upa.valueadd.reactor.Reactor.performChannelRead(Reactor.java:1750) 2017-06-07T11:58:10.220+05:30 [APP/0] [ERR] at com.thomsonreuters.ema.access.OmmBaseImpl.rsslReactorDispatchLoop(Unknown Source) 2017-06-07T11:58:10.220+05:30 [APP/0] [ERR] at com.thomsonreuters.ema.access.OmmBaseImpl.run(Unknown Source) 2017-06-07T11:58:10.220+05:30 [APP/0] [ERR] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) 2017-06-07T11:58:10.220+05:30 [APP/0] [ERR] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) 2017-06-07T11:58:10.220+05:30 [APP/0] [ERR] at java.lang.Thread.run(Thread.java:748)

Any leads on this?

Also the exchange rate we are fetching from EMA gives pricision upti 4 decimal places only. The same we get from RFA with higher rate of precision, Any suggestion how can we increase the precison using EMA, since our calculations are getting impacted.

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Update: The client cannot replicate this issue after upgrade the API to Elektron SDK 1.1.0

Answers

  • Hi @malika.gupta

    What is the EMA Java version that encounter problems?

    • For the exception issue, could you please give us a snippet code of your application that interacts with EMA Java
    • For the decimal issue, could you please give us example RICs that encounter the problem?
  • This is the snippet that registers the batch request with EMA :

      RFAMarketDataResponse dataResponse = null;
    try {
    RfaClient appClient = new RfaClient(countDown);
    ReqMsg reqMsg = createBatchRequestMsg(rfaRequest);
    if (null == ommConsumer) {
    throw new RealTimeDataNotAvailableException(
    REAL_TIME_DATA_AVAILABLE.getMessage(), null);
    }
    LOGGER.info("Calling EMA service started on: " + new Date());
    long startMillis = System.currentTimeMillis();
    ommConsumer.registerClient(reqMsg, appClient);
    boolean taskCompleted = countDown
    .await(marketDataConfig.rfaTimeOut, TimeUnit.SECONDS);
    if (!taskCompleted) {
    LOGGER.error(
    "Maximum time elapsed for the EMA service, "
    + "Please check the curernt timeout limit: "
    + marketDataConfig.rfaTimeOut);
    throw new BusinessException(
    MessageCodes.REQUEST_TIMEOUT.getCode());
    }
    dataResponse = appClient.getResponse();

    And this is the one that captures the response : callback and decodes the response:

       MarketDataField dataField = new MarketDataField();
    try {
    String name = refreshMsg.name();
    dataField.setItemName(name);
    if (DataType.DataTypes.FIELD_LIST == refreshMsg
    .payload()
    .dataType()) {
    decode(refreshMsg.payload().fieldList(), dataField);
    }
    LOGGER.debug("Market Data response received: "
    + System.currentTimeMillis());
    } catch (BusinessException e) {
    dataField.setError(new MarketDataError(
    MessageCodes.UNKNOWN_ERROR.getCode(), null));
    } finally {
    countDown.countDown();
    }
    We are creating single ommconsumer at app start up that makes the connection and serves multiple requests.

    We are using Elektron-SDK1.0.8.java

  • Hi Nitin

    Please see the file in this comment: 1026-demo3-mds.zip