# Two messages running with wrong MsgSeqNum

**URL:** <https://forum.fixtrading.org/t/two-messages-running-with-wrong-msgseqnum/13301>\
**Category:** General Q&A\
**Tags:** imported, 40-session, xid\_164844\
**Created:** [September 13, 2012, 10:08am UTC](https://forum.fixtrading.org/t/two-messages-running-with-wrong-msgseqnum/13301 "2012-09-13T10:08:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rustamgaifiev92\_x](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rustamgaifiev92\_x](https://forum.fixtrading.org/u/rustamgaifiev92_x)\
**Post date:** [September 13, 2012, 10:08am UTC](https://forum.fixtrading.org/t/two-messages-running-with-wrong-msgseqnum/13301/1 "2012-09-13T10:08:11Z")

</div>

Imported from previous forum

---

<div class="post-metadata">

**Author:** ![rustamgaifiev92\_x](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rustamgaifiev92\_x](https://forum.fixtrading.org/u/rustamgaifiev92_x)\
**Post date:** [September 13, 2012, 10:08am UTC](https://forum.fixtrading.org/t/two-messages-running-with-wrong-msgseqnum/13301/2 "2012-09-13T10:08:11Z")

</div>

So, I’ve looked at quckfix’s testcases and found out some strangeness, just simple scenario:  
conventional signs:  
\< - received

> - send

1 \< Logon{ Header: { BeginString: “FIX.4.2”, BodyLength: 57, MsgType: “A”, SenderCompID: “TW”, TargetCompID: “ISLD”, MsgSeqNum: 1, SendingTime: “20120913-08:52:27.000”}, EncryptMethod: 0, HeartBtInt: 30, Trailer: { CheckSum: “019”}}

2 \> Logon{ Header: { BeginString: “FIX.4.2”, MsgType: “A”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 1, SendingTime: “20120913-08:52:27.322”}, EncryptMethod: 0, HeartBtInt: 30}

3 \< SequenceReset{ Header: { BeginString: “FIX.4.2”, BodyLength: 58, MsgType: “4”, SenderCompID: “TW”, TargetCompID: “ISLD”, MsgSeqNum: 10, SendingTime: “20120913-08:52:27.000”}, GapFillFlag: “Y”, NewSeqNo: 20, Trailer: { CheckSum: “084”}}  
4 \< TestRequest{ Header: { BeginString: “FIX.4.2”, BodyLength: 56, MsgType: “1”, SenderCompID: “TW”, TargetCompID: “ISLD”, MsgSeqNum: 20, SendingTime: “20120913-08:52:27.000”}, TestReqID: “HELLO”, Trailer: { CheckSum: “096”}}

5 \> ResendRequest{ Header: { BeginString: “FIX.4.2”, MsgType: “2”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 2, SendingTime: “20120913-08:52:27.324”}, BeginSeqNo: 2, EndSeqNo: 0}

6 \< Logout{ Header: { BeginString: “FIX.4.2”, BodyLength: 45, MsgType: “5”, SenderCompID: “TW”, TargetCompID: “ISLD”, MsgSeqNum: 2, SendingTime: “20120913-08:52:27.000”}, Trailer: { CheckSum: “236”}}  
7 \> Logout{ Header: { BeginString: “FIX.4.2”, MsgType: “5”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 4, SendingTime: “20120913-08:52:27.326”}}

Please pay your attention to lines from 3 to 5, we have two messages running with wrong MsgSeqNum (10 and 20) and we have to send only 1 ResendRequest (according this script) ! Why ? It is nonsense for me, I did find out where this situation is specified into spec… It will be right to send 2 ResendRequest’s:

> ResendRequest{ Header: { BeginString: “FIX.4.2”, MsgType: “2”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 2, SendingTime: “20120913-08:52:27.324”}, BeginSeqNo: 2, EndSeqNo: 0}  
> ResendRequest{ Header: { BeginString: “FIX.4.2”, MsgType: “2”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 3, SendingTime: “20120913-08:52:27.325”}, BeginSeqNo: 2, EndSeqNo: 0}

Could you please comment who know.  
Thanks !

---

<div class="post-metadata">

**Author:** ![lanfrancomorini](https://avatars.discourse-cdn.com/v4/letter/l/ba8739/32.png) [@lanfrancomorini](https://forum.fixtrading.org/u/lanfrancomorini)\
**Post date:** [September 13, 2012, 10:24am UTC](https://forum.fixtrading.org/t/two-messages-running-with-wrong-msgseqnum/13301/3 "2012-09-13T10:24:59Z")

</div>

Hi Rustam,  
you should ignore SeqNum in case of Sequence reset…  
So, when you receive line 3 message, set your expected incoming SeqNum to 20 and then reply to Test Request (line 4 message).

Hope this helps

Lanfranco

> So, I’ve looked at quckfix’s testcases and found out some strangeness, just simple scenario:  
> conventional signs:  
> \< - received
> 
> > - send
> 
> 1 \< Logon{ Header: { BeginString: “FIX.4.2”, BodyLength: 57, MsgType: “A”, SenderCompID: “TW”, TargetCompID: “ISLD”, MsgSeqNum: 1, SendingTime: “20120913-08:52:27.000”}, EncryptMethod: 0, HeartBtInt: 30, Trailer: { CheckSum: “019”}}
> 
> 2 \> Logon{ Header: { BeginString: “FIX.4.2”, MsgType: “A”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 1, SendingTime: “20120913-08:52:27.322”}, EncryptMethod: 0, HeartBtInt: 30}
> 
> 3 \< SequenceReset{ Header: { BeginString: “FIX.4.2”, BodyLength: 58, MsgType: “4”, SenderCompID: “TW”, TargetCompID: “ISLD”, MsgSeqNum: 10, SendingTime: “20120913-08:52:27.000”}, GapFillFlag: “Y”, NewSeqNo: 20, Trailer: { CheckSum: “084”}}  
> 4 \< TestRequest{ Header: { BeginString: “FIX.4.2”, BodyLength: 56, MsgType: “1”, SenderCompID: “TW”, TargetCompID: “ISLD”, MsgSeqNum: 20, SendingTime: “20120913-08:52:27.000”}, TestReqID: “HELLO”, Trailer: { CheckSum: “096”}}
> 
> 5 \> ResendRequest{ Header: { BeginString: “FIX.4.2”, MsgType: “2”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 2, SendingTime: “20120913-08:52:27.324”}, BeginSeqNo: 2, EndSeqNo: 0}
> 
> 6 \< Logout{ Header: { BeginString: “FIX.4.2”, BodyLength: 45, MsgType: “5”, SenderCompID: “TW”, TargetCompID: “ISLD”, MsgSeqNum: 2, SendingTime: “20120913-08:52:27.000”}, Trailer: { CheckSum: “236”}}  
> 7 \> Logout{ Header: { BeginString: “FIX.4.2”, MsgType: “5”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 4, SendingTime: “20120913-08:52:27.326”}}
> 
> Please pay your attention to lines from 3 to 5, we have two messages running with wrong MsgSeqNum (10 and 20) and we have to send only 1 ResendRequest (according this script) ! Why ? It is nonsense for me, I did find out where this situation is specified into spec… It will be right to send 2 ResendRequest’s:
> 
> > ResendRequest{ Header: { BeginString: “FIX.4.2”, MsgType: “2”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 2, SendingTime: “20120913-08:52:27.324”}, BeginSeqNo: 2, EndSeqNo: 0}  
> > ResendRequest{ Header: { BeginString: “FIX.4.2”, MsgType: “2”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 3, SendingTime: “20120913-08:52:27.325”}, BeginSeqNo: 2, EndSeqNo: 0}
> 
> Could you please comment who know.  
> Thanks !

---

<div class="post-metadata">

**Author:** ![rustamgaifiev92\_x](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rustamgaifiev92\_x](https://forum.fixtrading.org/u/rustamgaifiev92_x)\
**Post date:** [September 13, 2012, 10:57am UTC](https://forum.fixtrading.org/t/two-messages-running-with-wrong-msgseqnum/13301/4 "2012-09-13T10:57:48Z")

</div>

> Hi Rustam,  
> you should ignore SeqNum in case of Sequence reset…  
> So, when you receive line 3 message, set your expected incoming SeqNum to 20 and then reply to Test Request (line 4 message).
> 
> Hope this helps
> 
> Lanfranco

Hi Lanfranco,

I’m sorry but you are wrong, please see spec. page 56 (a. Receive Sequence Reset (GapFill) message with MsgSeqNum \> than expected sequence number)

3 \< SequenceReset{ Header: { BeginString: “FIX.4.2”, BodyLength: 58, MsgType: “4”, SenderCompID: “TW”, TargetCompID: “ISLD”, MsgSeqNum: 10, SendingTime: “20120913-08:52:27.000”}, GapFillFlag: “Y”, NewSeqNo: 20, Trailer: { CheckSum: “084”}}

---

<div class="post-metadata">

**Author:** ![xavierbruyet](https://avatars.discourse-cdn.com/v4/letter/x/c5a1d2/32.png) [@xavierbruyet](https://forum.fixtrading.org/u/xavierbruyet)\
**Post date:** [September 13, 2012, 10:35am UTC](https://forum.fixtrading.org/t/two-messages-running-with-wrong-msgseqnum/13301/5 "2012-09-13T10:35:06Z")

</div>

Why do you want to send a second resend request while you know that you will receive all messages with the first one (EndSeqNo=0)?

> So, I’ve looked at quckfix’s testcases and found out some strangeness, just simple scenario:  
> conventional signs:  
> \< - received
> 
> > - send
> 
> 1 \< Logon{ Header: { BeginString: “FIX.4.2”, BodyLength: 57, MsgType: “A”, SenderCompID: “TW”, TargetCompID: “ISLD”, MsgSeqNum: 1, SendingTime: “20120913-08:52:27.000”}, EncryptMethod: 0, HeartBtInt: 30, Trailer: { CheckSum: “019”}}
> 
> 2 \> Logon{ Header: { BeginString: “FIX.4.2”, MsgType: “A”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 1, SendingTime: “20120913-08:52:27.322”}, EncryptMethod: 0, HeartBtInt: 30}
> 
> 3 \< SequenceReset{ Header: { BeginString: “FIX.4.2”, BodyLength: 58, MsgType: “4”, SenderCompID: “TW”, TargetCompID: “ISLD”, MsgSeqNum: 10, SendingTime: “20120913-08:52:27.000”}, GapFillFlag: “Y”, NewSeqNo: 20, Trailer: { CheckSum: “084”}}  
> 4 \< TestRequest{ Header: { BeginString: “FIX.4.2”, BodyLength: 56, MsgType: “1”, SenderCompID: “TW”, TargetCompID: “ISLD”, MsgSeqNum: 20, SendingTime: “20120913-08:52:27.000”}, TestReqID: “HELLO”, Trailer: { CheckSum: “096”}}
> 
> 5 \> ResendRequest{ Header: { BeginString: “FIX.4.2”, MsgType: “2”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 2, SendingTime: “20120913-08:52:27.324”}, BeginSeqNo: 2, EndSeqNo: 0}
> 
> 6 \< Logout{ Header: { BeginString: “FIX.4.2”, BodyLength: 45, MsgType: “5”, SenderCompID: “TW”, TargetCompID: “ISLD”, MsgSeqNum: 2, SendingTime: “20120913-08:52:27.000”}, Trailer: { CheckSum: “236”}}  
> 7 \> Logout{ Header: { BeginString: “FIX.4.2”, MsgType: “5”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 4, SendingTime: “20120913-08:52:27.326”}}
> 
> Please pay your attention to lines from 3 to 5, we have two messages running with wrong MsgSeqNum (10 and 20) and we have to send only 1 ResendRequest (according this script) ! Why ? It is nonsense for me, I did find out where this situation is specified into spec… It will be right to send 2 ResendRequest’s:
> 
> > ResendRequest{ Header: { BeginString: “FIX.4.2”, MsgType: “2”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 2, SendingTime: “20120913-08:52:27.324”}, BeginSeqNo: 2, EndSeqNo: 0}  
> > ResendRequest{ Header: { BeginString: “FIX.4.2”, MsgType: “2”, SenderCompID: “ISLD”, TargetCompID: “TW”, MsgSeqNum: 3, SendingTime: “20120913-08:52:27.325”}, BeginSeqNo: 2, EndSeqNo: 0}
> 
> Could you please comment who know.  
> Thanks !

---

<div class="post-metadata">

**Author:** ![rustamgaifiev92\_x](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rustamgaifiev92\_x](https://forum.fixtrading.org/u/rustamgaifiev92_x)\
**Post date:** [September 13, 2012, 10:54am UTC](https://forum.fixtrading.org/t/two-messages-running-with-wrong-msgseqnum/13301/6 "2012-09-13T10:54:40Z")

</div>

> Why do you want to send a second resend request while you know that you will receive all messages with the first one (EndSeqNo=0)?

I want to send second ResendRequest according to specifications (FIXT.1.1 “message recovery”, page 12). Nowhere specified that I should ignore TestRequest. I have to send ResendRequest or Heartbeat, but that script just send one ResendRequest. It’s seems to me one is not correspond specification.

I would like to remind that I’ve got this script from quckfix tests - 10\_MsgSeqNumGreater.def

---

<div class="post-metadata">

**Author:** ![xavierbruyet](https://avatars.discourse-cdn.com/v4/letter/x/c5a1d2/32.png) [@xavierbruyet](https://forum.fixtrading.org/u/xavierbruyet)\
**Post date:** [September 13, 2012, 11:24am UTC](https://forum.fixtrading.org/t/two-messages-running-with-wrong-msgseqnum/13301/7 "2012-09-13T11:24:43Z")

</div>

Actually there should be something in specifications which explains that incoming messages with too high sequence numbers may be ignored if we are already waiting for a ResendRequest reply. In your case, the counterpart sends a ResendRequest after receiving the message 3 and ignores the message 4 awaiting the reply of his ResendRequest.

Searching quickly, I found in FIXT 1.1 specifications: FIX Session-level State Matrix, state 12 (page 40)

"Awaiting/Processing Response to ResendRequest

Process requested MsgSeqNum PossDupFlag=Y resent messages and/or SequenceReset-Gap Fill messages from counterparty. Queue incoming messages with MsgSeqNum too high"

> > Why do you want to send a second resend request while you know that you will receive all messages with the first one (EndSeqNo=0)?
> 
> I want to send second ResendRequest according to specifications (FIXT.1.1 “message recovery”, page 12). Nowhere specified that I should ignore TestRequest. I have to send ResendRequest or Heartbeat, but that script just send one ResendRequest. It’s seems to me one is not correspond specification.
> 
> I would like to remind that I’ve got this script from quckfix tests - 10\_MsgSeqNumGreater.def

---

<div class="post-metadata">

**Author:** ![rustamgaifiev92\_x](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rustamgaifiev92\_x](https://forum.fixtrading.org/u/rustamgaifiev92_x)\
**Post date:** [September 13, 2012, 12:15pm UTC](https://forum.fixtrading.org/t/two-messages-running-with-wrong-msgseqnum/13301/8 "2012-09-13T12:15:39Z")

</div>

> Actually there should be something in specifications which explains that incoming messages with too high sequence numbers may be ignored if we are already waiting for a ResendRequest reply. In your case, the counterpart sends a ResendRequest after receiving the message 3 and ignores the message 4 awaiting the reply of his ResendRequest.
> 
> Searching quickly, I found in FIXT 1.1 specifications: FIX Session-level State Matrix, state 12 (page 40)
> 
> "Awaiting/Processing Response to ResendRequest
> 
> Process requested MsgSeqNum PossDupFlag=Y resent messages and/or SequenceReset-Gap Fill messages from counterparty. Queue incoming messages with MsgSeqNum too high"

What does it mean: “Queue incoming messages with MsgSeqNum too high”? It doesn’t seem to be ignore message…

---

<div class="post-metadata">

**Author:** ![xavierbruyet](https://avatars.discourse-cdn.com/v4/letter/x/c5a1d2/32.png) [@xavierbruyet](https://forum.fixtrading.org/u/xavierbruyet)\
**Post date:** [September 13, 2012, 2:26pm UTC](https://forum.fixtrading.org/t/two-messages-running-with-wrong-msgseqnum/13301/9 "2012-09-13T14:26:06Z")

</div>

> > Actually there should be something in specifications which explains that incoming messages with too high sequence numbers may be ignored if we are already waiting for a ResendRequest reply. In your case, the counterpart sends a ResendRequest after receiving the message 3 and ignores the message 4 awaiting the reply of his ResendRequest.
> > 
> > Searching quickly, I found in FIXT 1.1 specifications: FIX Session-level State Matrix, state 12 (page 40)
> > 
> > "Awaiting/Processing Response to ResendRequest
> > 
> > Process requested MsgSeqNum PossDupFlag=Y resent messages and/or SequenceReset-Gap Fill messages from counterparty. Queue incoming messages with MsgSeqNum too high"
> 
> What does it mean: “Queue incoming messages with MsgSeqNum too high”? It doesn’t seem to be ignore message…

There are two options:

- Either you send a ResendRequest from 2 to 10 and you queue messages with sequence numbers higher than 10. When you receive the message n°10, you can then process messages of your queue. However you take the responsability to treat queued messages of your counterpart with a delay.
- Or you send a ResendRequest from 2 to 0 (no limit), then you don’t need to queue messages since you expect the counterpart to resend them. When you receive the message n°10, you can assume your ResendRequest is complete and stop ignoring messages with too high sequence numbers (it means if the next message is not the n°11, then you need to send a second ResendRequest).

Normally these two approaches should be discussed in specifications (to check). I think there was already a discussion about it in the forum too.

---

<div class="post-metadata">

**Author:** ![rustamgaifiev92\_x](https://avatars.discourse-cdn.com/v4/letter/r/4491bb/32.png) [@rustamgaifiev92\_x](https://forum.fixtrading.org/u/rustamgaifiev92_x)\
**Post date:** [September 13, 2012, 3:22pm UTC](https://forum.fixtrading.org/t/two-messages-running-with-wrong-msgseqnum/13301/10 "2012-09-13T15:22:13Z")

</div>

> > > Actually there should be something in specifications which explains that incoming messages with too high sequence numbers may be ignored if we are already waiting for a ResendRequest reply. In your case, the counterpart sends a ResendRequest after receiving the message 3 and ignores the message 4 awaiting the reply of his ResendRequest.
> > > 
> > > Searching quickly, I found in FIXT 1.1 specifications: FIX Session-level State Matrix, state 12 (page 40)
> > > 
> > > "Awaiting/Processing Response to ResendRequest
> > > 
> > > Process requested MsgSeqNum PossDupFlag=Y resent messages and/or SequenceReset-Gap Fill messages from counterparty. Queue incoming messages with MsgSeqNum too high"
> > 
> > What does it mean: “Queue incoming messages with MsgSeqNum too high”? It doesn’t seem to be ignore message…
> 
> There are two options:
> 
> - Either you send a ResendRequest from 2 to 10 and you queue messages with sequence numbers higher than 10. When you receive the message n°10, you can then process messages of your queue. However you take the responsability to treat queued messages of your counterpart with a delay.
> - Or you send a ResendRequest from 2 to 0 (no limit), then you don’t need to queue messages since you expect the counterpart to resend them. When you receive the message n°10, you can assume your ResendRequest is complete and stop ignoring messages with too high sequence numbers (it means if the next message is not the n°11, then you need to send a second ResendRequest).
> 
> Normally these two approaches should be discussed in specifications (to check). I think there was already a discussion about it in the forum too.
