MsgSeqNum (FIX sequence number)
termKept in this browser · My desk
The number in MsgSeqNum(34) that each side of a FIX session assigns to every message it sends, in one series per direction, so the receiver can detect missing messages and ask for them again.
Both counters start at 1, are stored durably and are shared by session and application messages; resetting both to 1 starts a new session. Version 2.7 of 1994 already re-initialized sequence numbers each day, and FIX 4.0 made every message, administrative ones included, consume a number.
Detecting a gap. A message whose MsgSeqNum is greater than the expected NextNumIn reveals a gap; one lower than expected without PossDupFlag(43)=Y means broken state, and the session should end. Recovery. The receiver sends a ResendRequest (35=2) with BeginSeqNo(7) and EndSeqNo(16), 0 meaning all later messages. The sender retransmits with the original numbers, PossDupFlag=Y, a new SendingTime and the original time in OrigSendingTime(122); session messages are not resent but skipped with a SequenceReset (35=4) whose GapFillFlag(123)=Y and NewSeqNo(36) point past the gap, and stale application messages may be skipped the same way. A SequenceReset with GapFillFlag=N forces the counter and leaves the consequences with its sender. Resets. Continuous markets can reset in place with ResetSeqNumFlag(141) at an agreed time; allowing a reset at logon needs agreement, because the standard warns of order overfills. Not to be confused with PossResend(97), which an application sets on a message it resends under a new sequence number.
Also known as: msgseqnum, fix sequence number, resendrequest, resend request, sequencereset, gap fill, possdupflag, número de sequência fix
Sources
- FIX Session Layer technical standard, November 2020, section 4.1 (read 2026-11-15): unique MsgSeqNum(34) on every message; NextNumIn and NextNumOut start at 1, are persisted and shared by session and application messages; resetting both to 1 starts a new session
- FIX Session Layer technical standard, sections 4.8.1 to 4.8.6 (read 2026-11-15): gap when MsgSeqNum exceeds NextNumIn; ResendRequest with BeginSeqNo and EndSeqNo (0 for all); retransmission with PossDupFlag=Y and OrigSendingTime; session messages replaced by SequenceReset gap fill; Reset mode leaves responsibility with the sender
- FIX Session Layer technical standard, sections 4.4.2 and 4.4.3 (read 2026-11-15): ResetSeqNumFlag for 24-hour markets; reset at logon only by agreement, with the stated risk of order overfills
- FIXimate (Orchimate), MsgSeqNum(34) and EndSeqNo(16) (read 2026-11-15): integer message sequence number, added FIX 2.7; EndSeqNo 0 means infinity
- FIX 4.0 release notes, 13 January 1996 (read 2026-11-15): all messages increment the sequence number; some administrative messages replaced by Sequence Reset - Gap Fill; valid sequence numbers increased to 999,999