Detect No data or stale data for Level1 and Level2 subscriptions

mktdata
mktdata Contributor

Hello,

We are using RFA 8.1 C++ api to consume Level1 and Level2 data market data. Recently we came across many situations where our mutual client UBS reported multiple instances of No or stale Level1 and Level2 data. It happened across multiple exchanges. We are trying to figure out if api has some sort of sample application or utility tool that can be used to detect if data coming from your servers is itself has some problem or it's our adapter that has problem. Can you suggest approach here?

Best Answer

  • wasin.w
    wasin.w admin
    Answer ✓

    Hello @mktdata

    The RFA StartConsumer example has a code that checks (and prints) the Response Status message from the Provider. You can find it from the following methods.

    ### processLoginResponse ###

    void StarterConsumer::processLoginResponse(const rfa::sessionLayer::OMMItemEvent& event, const RespMsg& respMsg)
    {
       ...
       switch(respMsg.getRespType())
       {
          ...
          case RespMsg::StatusEnum:
                if(respMsg.getHintMask() & rfa::message::RespMsg::RespStatusFlag)
                {
                    if(status.getStreamState() == RespStatus::OpenEnum && status.getDataState() == RespStatus::OkEnum)
                    {
                        AppUtil::log(__LINE__, AppUtil::TRACE, "<- Received MMT_LOGIN Status - Login Accepted%s", text.c_str());
                        processLoginSuccess();
                    }
                    else if(status.getStreamState() == RespStatus::OpenEnum)
                        AppUtil::log(__LINE__, AppUtil::WARN, "<- Received MMT_LOGIN Status - Login Pending%s", text.c_str());
                    else
                        AppUtil::log(__LINE__, AppUtil::ERR, "<- Received MMT_LOGIN Status - Login Denied%s", text.c_str());
                }
                else
                    AppUtil::log(__LINE__, AppUtil::ERR, "<- Received MMT_LOGIN Status - No RespStatus");
                break;

    ### processMarketPriceResponse ###

    void StarterConsumer::processMarketPriceResponse(const rfa::sessionLayer::OMMItemEvent& event, const RespMsg& respMsg)
    {
       ...
       if(respMsg.getHintMask() & RespMsg::RespStatusFlag)
        {
            const RespStatus& status = respMsg.getRespStatus();
            text += OMMStrings::respStatusToString(status);
        }


    You can find more detail about the Status Response Message in the following sections of the RFA C++ Developer Guide:

    • Chapter 7.4.2 Response Status (Stream States, Data States, and Status Codes
    • Chapter 7.4.5 Processing RespMsg Example


Answers