Search code examples
quickfixfix-protocol

QuickFIX: Load a message from the logs


I am building a tool to replay logs. Manually parsing the logs is annoying, so I'm wondering if there is a way to simply load a message from the log.

Also, I am not against just using a third-party replay tool if one exists.


Solution

  • First read the log file by any mean you want, getting the individual lines (there is one message per line).

    Then build a Data Dictionary:

    // Use the version of the XML dictionary that is right for you
    FIX::DataDictionary dd("FIX44.XML");
    

    Then, for each line (as std::string str), build a message:

    FIX::Message msg(str, dd, false);
    

    Finally, handle the message just like your FIX::Application does, or better, call

    yourFixApplication.fromApp(msg, mySessionID);