How to detect closing run events?

How can the closing run events be detected? I am working on upgrading from rfa to ema and my application has some existing logic that executes on a closing run event. In rfa, I was able to detect closing run events by checking the MarketDataItemEvent.MarketDataMessageType (CLOSING_RUN)but I can't seem to find an equivalent for ema.

Best Answer

  • Hello @CAM

    In EMA Java, Closing run is
    defined as one type of UpdateTypeNum component in an Market Price Update
    Message shown in EMAJ_RDMUsageGuide.pdf below:

    image

    EMA Java provides com.thomsonreuters.ema.access.UpdateMsg.updateTypeNum() method to get
    UpdateTypeNum component as explained in EMA
    Java document of UpdateMsg class:

    image

    Hence, you can use the method to
    check if a message received in onUpdateMsg(..)
    is closing run event or not. The snipped
    example application source code is shown below:

    public void onUpdateMsg(UpdateMsg updateMsg, OmmConsumerEvent event) 
    {

    int updateTypeNum = updateMsg.updateTypeNum();
    if(updateTypeNum==com.thomsonreuters.ema.rdm.EmaRdm.INSTRUMENT_UPDATE_CLOSING_RUN)
    {
    //process closing run event

    }

    }