Search code examples
pythonpython-3.xquickfix

Resetting acceptor sequence numbers as an initiator without ability to use onLogon


Hello I have run into an issue that is usually a common fix but mine has a twist. The usual answer I will quote here:

"Sequence numbers between the client and the server has to be sync. In your case even if you reset the sequence number, you will get the same error because the client will send a larger sequence number that you have. It is a common practice that both the client and the server resets the sequence numbers on agreement(on logon,each day or sending 141=Y etc.)."

The problem is that this flag "ResetMsgSeqNum" can only be used in the onLogon method in Quickfix.

I am not able to login because the sequence numbers are out of sync so I do not have the opportunity to tell the acceptor to reset it's sequence numbers as well.

There have been suggestions to increment to the next sequence number as well however those were for the Java Quickfix and I am unaware how to do this in the python version. I will post a sample of my log below of what is happening.

NOTE: I have removed identifying info only from the even logs so the tags are not actually blank below. Messages such as "onCreate" are debugging statements to indicate if a method has been successfully been executed.

I appreciate any and all help!

onCreate
<20180618-22:50:15.000000000, FIX.4.4:, event>
  (Created session)
<20180618-22:50:15.000000000, FIX.4.4:, event>
  (Connecting to on port 8101 (Source :0))
toAdmin
<20180618-22:50:15.000000000, FIX.4.4:, outgoing>
  (8=FIX.4.4 9=112 35=A 34=13 49= 52=20180618-22:50:15.000 56= 554=PASSWORD
<20180618-22:50:15.000000000, FIX.4.4:, event>
  (Initiated logon request)
<20180618-22:50:16.000000000, FIX.4.4:, incoming>
  (8=FIX.4.4 9=76 35=5 34=6 49= 52=20180618-22:50:16.227 56= 10=171 )
fromAdmin
<20180618-22:50:16.000000000, FIX.4.4:, event>
  (Received logout request)
toAdmin
<20180618-22:50:16.000000000, FIX.4.4:, outgoing>
  (8=FIX.4.4 9=77 35=5 34=14 49= 52=20180618-22:50:16.000 56= 10=208 )
<20180618-22:50:16.000000000, FIX.4.4:, event>
  (Sending logout response)
<20180618-22:50:16.000000000, FIX.4.4:, event>
  (Disconnecting)
onLogout
toAdmin
<20180618-22:50:16.000000000, FIX.4.4:, event>
  (Initiated logon request)
onLogout

Solution

  • Setting the ResetSeqNumFlag=Y should fix your problem. What it does is that it sets the ResetSeqNumFlag(141) tag to Y. Then this tag is included into the login request so even you are out of sync, the acceptor will reset the sequence numbers.