quickfixgo / quickfix

The Go FIX Protocol Library :rocket:

Home Page:https://www.quickfixgo.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logout Messages Ignored while in the Logon State

avislash opened this issue · comments

Any Logout Messages sent by an Acceptor to an Initiator are ignored by the Initiator while it is in the Logon state.

This is buggy behavior since most FIX acceptors will issue Logout Messages with Tag 58 set to indicate why a Logon attempt has failed (i.e. due to either the sequence count being too low or the authentication credentials being invalid).

In the case that the sequence count is too low then the user should be given an option to be able to configure either the quickfix library or their application to sync to the exepcted sequence count. As it currently stands the library will not propagate any Logout messages sent to by the Acceptor to user space if the Initator is in the Logon state.

I propose updating the config file to allow the user to configure the quickfix library to automatically sync up to the correct sequence number (Note the user will need to provide the Text String sent by the Acceptor in addition to configuring this option) and updating the logonstate FixMsgIn() method to handle a logout message to accomplish this.

Currently the way things are setup the Logon when the expected sequence number is too low can only be successful after N Logon messages have been sent and this can lead to a Logon delay of hours which is not desirable behavior.

Let me know if this sounds good and I can work on getting a PR together or if there's another path to be taken here.

If one counterparty's seq nums are too low during logon, is there no way to handle this automatically while guaranteeing proper delivery of all messages. If you really want to thwart this guarantee of FIX protocol, there's already a SessionSetting for that: ResetOnLogon=Y.

What about when counterparties don't allow for a ResetOnLogon?