How can I check which record could not be find using EMA ?

I have a question about I receive a status message which record couldn't be find when I register a contract. I used a for-loop to register many contracts at one time. How can I identify the message from which contract? Please help me find the answer. Thanks.

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    You can use StatusMsg.getName() to retrieve the name of subscribed contract.

    void AppClient::onStatusMsg( const StatusMsg& statusMsg, const OmmConsumerEvent& ) 
    {
    cout << statusMsg << endl;
    cout << statusMsg.getName().c_str() << endl;
    cout << statusMsg.getState().getStatusText().c_str() << endl;
    }

    The output is:

    StatusMsg
    streamId="5"
    domain="MarketPrice Domain"
    state="Closed / Suspect / Not found / 'The record could not be found'"
    name="FA"
    nameType="1"
    serviceId="2115"
    serviceName="API_ELEKTRON_EPD_RSSL"
    StatusMsgEnd

    FA
    The record could not be found

Answers