MsgSeqNum too low expecting 11 but received 4
While working on FIX protocol to send and recieve message it’s very common to get exception and this is one which we get while trying to setup your environment.
quickfix.SessionException MsgSeqNum too low, expecting 11 but received 4
<20150815-15:00:42, FIX.4.2:FixClient8019->FixAcceptor, event> (Session FIX.4.2:FixClient8019->FixAcceptor schedule is daily, 00:00:00 UTC - 00:00:00 UTC (daily, 00:00:00 UTC - 00:00:00 UTC)) <20150815-15:00:42, FIX.4.2:FixClient8019->FixAcceptor, event> (Created session: FIX.4.2:FixClient8019->FixAcceptor) Inside onCreate Aug 15, 2015 11:00:42 AM quickfix.mina.NetworkingOptions logOption INFO: Socket option: SocketTcpNoDelay=true Aug 15, 2015 11:00:42 AM quickfix.mina.NetworkingOptions logOption INFO: Socket option: SocketSynchronousWrites=false Aug 15, 2015 11:00:42 AM quickfix.mina.NetworkingOptions logOption INFO: Socket option: SocketSynchronousWriteTimeout=30000 Sending Order to Server Aug 15, 2015 11:00:42 AM quickfix.mina.initiator.InitiatorIoHandler sessionCreated INFO: MINA session created: /127.0.0.1:51377 <20150815-15:00:43, FIX.4.2:FixClient8019->FixAcceptor, outgoing> (8=FIX.4.29=8035=A34=1049=FixClient801952=20150815-15:00:43.77856=FixAcceptor98=0108=6010=232) <20150815-15:00:43, FIX.4.2:FixClient8019->FixAcceptor, event> (Initiated logon request) <20150815-15:00:43, FIX.4.2:FixClient8019->FixAcceptor, incoming> (8=FIX.4.29=7935=A34=149=FixAcceptor52=20150815-15:00:43.85856=FixClient801998=0108=6010=191) <20150815-15:00:43, FIX.4.2:FixClient8019->FixAcceptor, incoming> (8=FIX.4.29=7635=234=249=FixAcceptor52=20150815-15:00:43.85856=FixClient80197=116=010=013) <20150815-15:00:43, FIX.4.2:FixClient8019->FixAcceptor, outgoing> (8=FIX.4.29=11835=534=1149=FixClient801952=20150815-15:00:43.88956=FixAcceptor58=MsgSeqNum too low, expecting 11 but received 110=189) <20150815-15:00:43, FIX.4.2:FixClient8019->FixAcceptor, event> (quickfix.SessionException MsgSeqNum too low, expecting 11 but received 1) <20150815-15:00:43, FIX.4.2:FixClient8019->FixAcceptor, event> (Disconnecting) Aug 15, 2015 11:00:44 AM quickfix.mina.initiator.InitiatorIoHandler sessionCreated INFO: MINA session created: /127.0.0.1:49786 <20150815-15:00:45, FIX.4.2:FixClient8019->FixAcceptor, outgoing> (8=FIX.4.29=8035=A34=1249=FixClient801952=20150815-15:00:45.76756=FixAcceptor98=0108=6010=234) <20150815-15:00:45, FIX.4.2:FixClient8019->FixAcceptor, event> (Initiated logon request) <20150815-15:00:45, FIX.4.2:FixClient8019->FixAcceptor, incoming> (8=FIX.4.29=7935=A34=449=FixAcceptor52=20150815-15:00:45.76756=FixClient801998=0108=6010=195) <20150815-15:00:45, FIX.4.2:FixClient8019->FixAcceptor, outgoing> (8=FIX.4.29=11835=534=1349=FixClient801952=20150815-15:00:45.76756=FixAcceptor58=MsgSeqNum too low, expecting 11 but received 410=191) <20150815-15:00:45, FIX.4.2:FixClient8019->FixAcceptor, incoming> (8=FIX.4.29=7635=234=549=FixAcceptor52=20150815-15:00:45.76756=FixClient80197=116=010=017) <20150815-15:00:45, FIX.4.2:FixClient8019->FixAcceptor, event> (quickfix.SessionException MsgSeqNum too low, expecting 11 but received 4) <20150815-15:00:45, FIX.4.2:FixClient8019->FixAcceptor, event> (Disconnecting) <20150815-15:00:45, FIX.4.2:FixClient8019->FixAcceptor, incoming> (8=FIX.4.29=6735=534=649=FixAcceptor52=20150815-15:00:45.76756=FixClient801910=154) Stoping socketInitiator Aug 15, 2015 11:00:45 AM quickfix.mina.SessionConnector logoutAllSessions INFO: Logging out all sessions Acknowledgement received: --> null
Solution: This exception happens if hou fix file format below is not mathcing with ther server files these file are:
and on Initiator side it should be somehting like below and file inside red box is not needed so delete them out:
Once you run your acceptor or server you will these extract will be generated by the API:
- This should fix the issue. (Probably after doing all these you may get same exception first time but second time onwareds it will work OK, this could be API level bug)
- For more informaiton please visit QuickFix site here