0

I'm working with quickfixgo 5.0. in the FromApp function I'm receiving the execution report message and parsing it and trying to store it in the db. but what happens if my db connection fails and it returns error? I need to get the execution message again. but the message sender doesn't support msgType=H(OrderStatusRequest). how can I make sure that the system can have the latest order statuses?

func (e FixApp) FromApp(msg *quickfix.Message, sessionID quickfix.SessionID) (reject quickfix.MessageRejectError) {
    messageDTO := model.MessageDTO{Message: msg}
    executionReport, err := messageDTO.ToExecutionReport()
    if err != nil {
        return err
    }

    e.PersistExecutionError(executionReport)
    return
}

there is also a ResendRequest msgType. and it gets from seqNumber and to segNumber. but what if my system restarted and I needed to logon again and reset the seqNumber?

  • I can only speak for QuickFIX/J but I assume it is similar on quickfixgo: if an exception or error is encountered in the FromApp callback the message sequence number is not incremented an on the next incoming message the seqnum will be out of sync. Then the missing message is re-requested via the resend request logic. – Christoph John Aug 21 '23 at 13:28
  • @christoph-john thank you for your answer but what if an error happens and my service restarted at the same time? then the session will be reinitiated, the logon message will reset seqNum. should I store the seqNum in the db and then set the seqNum in the first message? is it possible? – Fahimeh Fathian Rad Aug 22 '23 at 12:57
  • You can choose whether the Logon message will reset the sequence number. This is controlled by the tag 141/ResetSeqNumFlag. Probably the option `ResetOnLogon=Y` is set in your config or you are an acceptor and the counter party sends you 141=Y on their Logon message. – Christoph John Aug 23 '23 at 09:10

0 Answers0