2

I do see that this has been asked before, but I see no answer as yet. Is there a way to replay a quickfix log file? My app initiated the session, receives data, quickfix logs the data, my app crashes. When I restart I want to simple replay everything in the log file. Can that be done?

Or if not, does anyone have an example of how to programatically request a resend of all session messages or of resetting the receive seq# to 1? Any help would be appreciated.

Al Kurlansky
  • 275
  • 3
  • 18

2 Answers2

3

No, not really.

FIX is a two-way communication protocol. You can't just "replay" one side; that doesn't really make sense.

That's like saying you want Alice to restart a conversation with Bob, but Alice must read her lines from a transcript of what she said before. You have no guarantee that Bob will say what he said before, and Bob might just be confused.

Now, if you're talking about some kind of test tool, where one side is "playing" data that is predetermined... well, you should be more specific in your question. That said, QuickFIX provides no feature for doing such a thing, and doesn't really lend itself to doing that. You'd be better off writing a standalone tool that writes those messages to a raw socket. (My firm has actually written such a test tool.)

Regarding sequence numbers, check the "ResetOn<XXX>" configuration settings. You probably want ResetOnLogon or the like. (Make sure your initiator's seq# policy is the same as your counterparty's, or you will have problems.)

If you think you have to programmatically reset your sequence number, you are probably doing something wrong. Four years on the QF mailing lists have taught me this. I've never seen anyone legitimately need to do this.

Grant Birchmeier
  • 17,809
  • 11
  • 63
  • 98
  • Thanks for the responses. They both have facilitated me in making better design choices. – Al Kurlansky Nov 01 '12 at 16:32
  • I highly recommend joining the mail list for your version of QuickFIX. The s/n ratio is low, traffic is not too high, and I think you can learn a lot just from reading the discussions. (Also, be sure to check out QF/j and QF/n for Java and C#, if those languages are relevant to you.) – Grant Birchmeier Nov 01 '12 at 21:24
1

Make sure your settings in the config file are set not to reset on logon. The when you reconnect after a crash you will automatically do a resend of all the message that were missed.

robthewolf
  • 7,343
  • 3
  • 29
  • 29
  • Yes, good call. I want to add that this only works if the other side supports it, and that's not a guarantee. Check their docs if it's an outside connection. – Grant Birchmeier Oct 31 '12 at 20:49