Imported from previous forum
I just want to be absolutely sure in the next question:
Buy side FIXEngine(buyFE) wants to create a FIX session with the sell side FIXEngine(sellFE).
SellFE expects incoming message SeqNum 10.
BuyFE sends Logon with SeqNum 5.
And the question is: How should the sellFE respond to incoming logon message with low SeqNum?
Should sellFE:
- respond with Logout (describing logout reason) and terminate the session.
- respond with Logon and after that Logout (describing logout reason) and terminate the session
- terminate session without sending any messages
- other variants
Any help will be appreciated
Thanks.
[ original email was from Matt Koehler - matt.koehler@transacttools.net ]
From the spec:
NOTE: In ALL cases except the Sequence Reset - Reset message, the FIX session should be terminated if the incoming sequence number is less than expected and the PossDupFlag is not set. A Logout message with some descriptive text should be sent to the other side before closing the session.
-Matt
> I just want to be absolutely sure in the next question:
> Buy side FIXEngine(buyFE) wants to create a FIX session with the sell side FIXEngine(sellFE).
> SellFE expects incoming message SeqNum 10.
> BuyFE sends Logon with SeqNum 5.
> And the question is: How should the sellFE respond to incoming logon message with low SeqNum?
>
> Should sellFE:
> 1) respond with Logout (describing logout reason) and terminate the session.
> 2) respond with Logon and after that Logout (describing logout reason) and terminate the session
> 3) terminate session without sending any messages
> 4) other variants
>
> Any help will be appreciated
> Thanks.
>
[ original email was from kirk benson - kirk.benson@phlx.com ]
In the 4.2 Spec, I see the following:
"Sequence numbers are initialized at the start of each FIX session (see Session Protocol section) starting at 1 (one) and increment throughout the session."
Later in the same spec, I see:
"A FIX session is comprised of three parts: logon, message exchange and logout."
From these two statements, I can conclude that all Logon messages should have a sequence number of 1. Is this in fact correct, or can they in fact have sequence numbers equal to the Logout message + 1?
> From the spec:
>
> NOTE: In ALL cases except the Sequence Reset - Reset message, the FIX session should be terminated if the incoming sequence number is less than expected and the PossDupFlag is not set. A Logout message with some descriptive text should be sent to the other side before closing the session.
>
> -Matt
>
> > I just want to be absolutely sure in the next question:
> > Buy side FIXEngine(buyFE) wants to create a FIX session with the sell side FIXEngine(sellFE).
> > SellFE expects incoming message SeqNum 10.
> > BuyFE sends Logon with SeqNum 5.
> > And the question is: How should the sellFE respond to incoming logon message with low SeqNum?
> >
> > Should sellFE:
> > 1) respond with Logout (describing logout reason) and terminate the session.
> > 2) respond with Logon and after that Logout (describing logout reason) and terminate the session
> > 3) terminate session without sending any messages
> > 4) other variants
> >
> > Any help will be appreciated
> > Thanks.
> >
>
No you definitely should not conclude that all Logon messages have a MsgSeqNum of 1.
Your first citation includes “(see Session Protocol section)”. The second sentence in the 4.2 Spec’s “Session Protocol” section states:
“A single FIX session can exist across multiple physical connections. Parties can connect and disconnect multiple times while maintaining a single FIX session. Connecting parties must bi-laterally agree as to when sessions are to be started/stopped based upon individual system and time zone requirements.”
The key is that a "FIX Session" can be disrupted and then re-established which results in multiple "connections" but the same "FIX Session". A "FIX Session" is probably better defined as lasting the duration counterparties agree to and "begins" when counterparties reset MsgSeqNum back to 1.
I agree that the use of the term "FIX Session" within the spec is currently challenging (opportunity for improvement). Just remember that a "FIX Session" does not equate to a TCP socket/session. Another key consideration with regards to resetting MsgSeqNum back to 1 is that you lose all ResendRequest recoverability of messages.
You should also refer to the “FIX Session-level Test Cases and Expected Behavior” document within the FIX website’s “Organization”, “Technical Committee” archive (also part of Volume 2 in FIX 4.3 spec). This documents session-level “states”.
> In the 4.2 Spec, I see the following:
>
> "Sequence numbers are initialized at the start of each FIX session (see Session Protocol section) starting at 1 (one) and increment throughout the session."
>
> Later in the same spec, I see:
>
> "A FIX session is comprised of three parts: logon, message exchange and logout."
>
> From these two statements, I can conclude that all Logon messages should have a sequence number of 1. Is this in fact correct, or can they in fact have sequence numbers equal to the Logout message + 1?
>