Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

msgSeqNum in the Header #54

Open
uwezukwechibuzor opened this issue Apr 4, 2023 · 3 comments
Open

msgSeqNum in the Header #54

uwezukwechibuzor opened this issue Apr 4, 2023 · 3 comments

Comments

@uwezukwechibuzor
Copy link
Contributor

what is msgSeqNum?

msgSeqNum is a field in the FIX protocol message header that is used to assign a unique sequence number to each message. This field contains a numeric value that is incremented by one for each message sent. The sequence numbers are used by the receiving party to ensure that messages are received in the correct order and to detect missing or duplicate messages.

For example, if a sender sends three messages with sequence numbers 1, 2, and 3, the receiver will expect to receive those messages in that order. If the receiver receives message 3 before message 2, it will know that a message is missing and can request a retransmission. Similarly, if the receiver receives two messages with the same sequence number, it will know that there is a duplicate message and can discard one of them.

The msgSeqNum field is an important part of the FIX protocol's reliability and consistency mechanisms, and helps to ensure that messages are properly processed and recorded by both the sender and receiver.

@uwezukwechibuzor
Copy link
Contributor Author

Is msgSeqNum automatically generated?

Yes, msgSeqNum is automatically generated by the FIX protocol implementation and assigned by the sending party. The sender increments the value of msgSeqNum by one for each message sent and includes it in the message header. The value of msgSeqNum is unique for each message and helps to ensure that messages are received in the correct order and that duplicate or missing messages can be detected.

The msgSeqNum field is essential to maintaining the integrity and consistency of the FIX protocol message stream. It provides a reliable and consistent means of identifying each message and establishing its position within the message stream. As such, it is important that each implementation of the FIX protocol maintains accurate and synchronized msgSeqNum values to prevent errors and ensure that messages are properly processed and recorded

@uwezukwechibuzor
Copy link
Contributor Author

can the user input the field manually?

While it is technically possible to manually input the msgSeqNum field in a FIX protocol message, it is not recommended to do so.

The msgSeqNum is a critical part of the FIX protocol's reliability and consistency mechanisms, as it is used to ensure that messages are received in the correct order and to detect missing or duplicate messages. If a user manually inputs the msgSeqNum value, it can lead to errors, such as duplicate or missing messages, that can cause problems in the transaction processing.

Moreover, FIX protocol implementations are expected to generate msgSeqNum values automatically and maintain their accuracy and synchronization. If the msgSeqNum is manually inputted, it may cause issues with compliance or regulatory requirements that require an audit trail of message transmission.

In general, it is best to rely on the automatic generation of msgSeqNum by the FIX protocol implementation rather than manually inputting the value

@uwezukwechibuzor
Copy link
Contributor Author

should it always be the same in the same session

No, msgSeqNum should not always be the same in the same session. The msgSeqNum field in the FIX protocol message header is designed to be incremented by one for each message sent within a given session. Each new message should have a msgSeqNum value that is one greater than the previous message sent in that session.

This ensures that messages are received in the correct order and that any missing or duplicate messages can be identified and handled appropriately. If the msgSeqNum remains the same throughout the session, it could lead to errors and inconsistencies in the transaction processing.

It is important to note that the msgSeqNum field is reset to 1 at the start of each new session. Therefore, the sequence of msgSeqNum values is unique for each session and is not meant to be continuous across different sessions.

In summary, the msgSeqNum field should be unique and incremented for each message sent within a session, and reset to 1 at the start of each new session

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant