• Programming Guide
  • Api Documentation
  • OnixS .NET Core / .NET 6 FIX Engine, version 1.9.0
Show / Hide Table of Contents
  • Introduction
  • System Requirements
  • Project Dependency Management
  • Getting Started
  • Error Reporting
  • Licensing
  • Engine Initialization and Shutdown
  • Selecting FIX Version
  • FIX Message
    • Manipulating Message Fields
  • FIX Session
    • Establishing FIX Connection
    • Exchanging Messages
    • Message Sequence Numbers
  • Configuring the Engine
    • Loading Engine Settings From Configuration Files
    • Multiple Listen Ports
  • Venue Specific Settings
    • CME Specific Settings
  • Logging Services
    • Selecting Session Storage
    • Customizing Message Logging
  • Thread Safety
  • Repeating Groups
  • Sessions
    • Session States
    • Session Events
    • Accepting FIX Session Without a Prior Creation of Session Object
    • Custom Logon Message
    • Logon Authentication
    • Establishing FIX Connection via Proxy
    • Resetting Message Sequence Numbers
    • Resetting Message Sequence Numbers via ResetSeqNumFlag Field
    • Resending Messages
    • Memory-based Session Storage
    • File-based Session Storage
    • Async File-based Session Storage
    • Pluggable Session Storage
    • Scheduling Session for Automatic Connection
      • Session Schedule
      • Session Connection Settings
      • XML-based Schedules and Connection Settings
    • Failover
    • Message Sending Latency
    • Message Throttling
  • Messaging
    • Manipulating Real Numbers
    • Message Validation
    • Serialized FIX Messages
    • Typed FIX Messages
    • Flat Messages
      • Flat Group Reader
    • Using LINQ
  • FIX Dictionary
    • XML-based Dictionary Description
    • Session-level Dictionary
    • Dictionary Exploration
    • Using QuickFIX Data Dictionary
  • Engine Events
  • TLS/SSL Encryption
    • Using TLS/SSL Encryption
    • Supported Certificates
    • Session-level TLS/SSL Settings
    • Verification of Client SSL Certificates
    • Custom verification of SSL Certificates
    • TLS/SSL Troubleshooting
  • FAST Coding
    • Encoding And Decoding Data Using FAST
    • FAST Template
    • Generating FIX Dictionaries For FAST Coding
    • FAST Exceptions
  • FIXML Converter
  • Reducing Garbage Collection Overhead
  • Best Practices
    • Low Latency Best Practices
    • High Throughput Best Practices
  • Migration Guide
  • Frequently Asked Questions
  • Glossary
  • External Resources
  • Support

Message Sequence Numbers

Understanding Message Sequencing

A single FIX session can exist across multiple sequential (not concurrent) physical connections.

Parties can connect and disconnect multiple times while maintaining a single FIX session.

All FIX messages are identified by a unique sequence number (the MsgSeqNum field) within the bounds of a single FIX session.

Sequence numbers are initialized at the start of each FIX session starting at 1 (one) and increment throughout the session.

Each session establishes an independent incoming and outgoing sequence series.

The FIX Engine automatically synchronizes sequence numbers when reconnecting a FIX session from the information that was previously stored in the Session log files.

messageSequenceNumbers

Changing Session Sequence Numbers

Monitoring sequence numbers enable parties to synchronize applications gracefully when reconnecting during a FIX session.

To get the expected sequence number of the next incoming message use the InSeqNum property.

To get the sequence number of the next outgoing message use the OutSeqNum property.

Resetting inbound and outbound message sequence numbers back to 1, for whatever reason, constitutes the beginning of a new FIX session.

Use the ResetLocalSequenceNumbers() method to back up the previous log files and reset the sequence numbers to 1.

Note

Both InSeqNum and OutSeqNum properties can be used to set expected sequence numbers manually before a FIX connection is established. However, it is NOT recommended to use these properties to reset the message sequence numbers to 1. Instead, use the ResetLocalSequenceNumbers() method.

Some implementations of the FIX protocol expect that a FIX Session coincides with a FIX Connection. In this case, message sequence numbers must be reset back to 1 after the Logout messages exchange.

To work with such FIX venues, the keepSequenceNumbersBetweenFixConnections parameter of Session(String, String, Dictionary, Boolean, SessionStorageType, String) constructor should be set to false. In this case after the Logout(Boolean) method sequence numbers are set back to 1. Next time when the Session instance is created incoming and outgoing message sequence numbers will start from 1 (in other words, a new FIX Session will be created).

See Also

  • Resetting Message Sequence Numbers
  • Resetting Message Sequence Numbers via ResetSeqNumFlag Field
  • File-based Session Storage
In This Article
Back to top Copyright © Onix Solutions.
Generated by DocFX