Quickfix reset sequence number at start time but not set ResetSeqNum in Logon message
Solution 1
This appears to be a QuickFIX/J quirk (some might consider it a bug). If ResetOnLogon=N then no ResetSeqNumFlag=Y is sent when the session start time triggers a logon. If ResetOnLogon=Y, the ResetSeqNumFlag=Y is sent on every logon. I believe this is not a big problem in practice because participants in a FIX session typically reset their sequence numbers locally after a session ends (logically ends at the end time, not a connection disconnect).
If you want to slightly modify the source code to implement this behavior, you'd modify the quickfix.Session next() method. You could add a local flag that indicates a session has restarted (per the schedule as determined by checkSessionTime()). Pass that flag to generateLogon() and that method would use it to determine when to send ResetSeqNumFlag=Y regardless of the ResetOnLogon configuration.
Solution 2
I don`t want to reset the sequence on every log-on.
Then don't do it! Set ResetOnLogon=N
.
At StartTime, the session will reset sequence numbers always. If ResetOnLogon=N
, then they won't reset again until the next StartTime.
The initiator and acceptor should always have matching ResetOnXXX
settings.
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on June 11, 2022Comments
-
Admin about 2 years
When the quickfix initiator reconnects at
startTime
(defined in config) it deletes the files with sequence number, but does not setResetSeqNumFlag
toY
, and the server replies with aLogout
message with text "seq msg number to low ..." Is there a way to setResetSeqNumFlag = Y
only for this behavior? I don`t want to reset the sequence on every log-on. -
Admin over 10 yearsIt is already setted: ResetOnLogon=N. And in next startTime new Logon message send without ResetSeqNumFlag. But server do not reset own sequence and do not expect message seq=1
-
Admin over 10 yearsThank you, I already made it easier: I check seq number for logon message before send it and if seqNum=1 then add ResetSeqNumFlag to this message.
-
Grant Birchmeier over 10 yearsThat sound like a bug in the Acceptor's engine (whoever it might be). After StartTime, both sides should start with and expect 1. ResetSeqNumFlag=Y shouldn't even be necessary; it's implied. The QF/J behavior sounds fine to me.
-
Grant Birchmeier over 10 yearsThis sounds like the server is acting incorrectly. They shouldn't need to see your flag. They should just reset after StartTime anyway. Are you sure you have their correct session start/end times?
-
Smoke almost 10 yearsstackoverflow.com/questions/19516982/… any solution ?