[Quickfix-developers] Reseting sequence numbers
Brought to you by:
orenmnero
From: Brian E. <azz...@ya...> - 2007-12-13 03:15:10
|
This is probably a dumb question, but I'm wondering if there is a specific call that would allow you to reset sender and target sequence numbers for the next logon. The idea here is that sometimes, the initiator and the acceptor are so out of sync (number of messages to be resent number in the hundreds or thousands) or is otherwise so messed up that it's better to start from scratch and ignore the built up history. (Some exchanges like SFE will error out if you request a gap-resend of greater than a few hundred and you can't really sync back up.) Expecting an operator to handle these exceptional cases by bringing down the application, clearing the data directories and bringing everything back up is asking a lot. In my homegrown FIX engine, I have a method that allows me to set a "reset on next login ONLY" and "recycle the connection" and I tie that to a drop-down menu. If we're in one of those exceptional cases, one quick click with a confirm and the app simply reconnects - resetting the sequence numbers in the process. The only way I can think to do this in QuickFIX is to temporarily set the ResetOnLogon flag for the session to "true", recycle the connection and then set the flag back to "false" during the onLogon callback. For a brief period, I thought that perhaps the reset() method would work, but although it resets the sequence numbers and disconnects, it does not end up setting the ResetSeqNumFlag on the next Logon message (because none of the m_resetOnXXX members are set). As I said, I can work around this, but was wondering if there was a more straightforward way to do so. - Brian Erst |