[Quickfix-developers] RE: In-Session Logon to Reset Sequence Number
Brought to you by:
orenmnero
|
From: Jain, A. <Ani...@rb...> - 2006-01-19 17:05:58
|
OK, I was able to do daily in-session logon reset (for weekly session conne= ction) ONLY from the toAdmin callback. =20 Sure 1.10.2 release notes say that the "logon" message may be modified for = inserting ResetSeqNumFlag=3DY in toAdmin callback.=20 However "in-session logon" needed to reset sequence numbers, probably would= make more sense from fromAdmin, as it has to be done only after we receive= heartbeat response? The FIX protocol document says: =20 One side will initiate the process by sending a TestRequest and wait for a = Heartbeat in response to ensure of no sequence number gaps. Once the Heart= beat has been received, the initiator should send a Logon with ResetSeqNumF= lag set to Y and with MsgSeqNum of 1. The acceptor should respond with a L= ogon with ResetSeqNumFlag set to Y and with MsgSeqNum of 1. At this point = new messages from either side should continue with MsgSeqNum of 2. To achieve this, I merely flagged for logon reset in fromAdmin heartbeat in= tercept and than waited for next heartbeat intercept in toAdmin to initiate= in-session logon. I wonder, if somebody out here was able to do it in a cleaner way. =20 Thanks. =20 Anil =20 =20 -----Original Message----- From: Jain, Anil=20 Sent: Tuesday, January 17, 2006 2:31 PM To: qui...@li... Subject: In-Session Logon to Reset Sequence Number Hi, =20 It's been a good experience for us using QuickFIX. Thank you very much. Recently, I attempted using In-Session logon to reset sequence numbers at s= tart of day. I am the initiator. The logon is successfully responded by the acceptor ECN, but QuickFIX immed= iately reacts with a logout message "MsgSeqNum too low, expecting 2 but re= ceived 1". Am I missing something? =20 Cheers. =20 Anil =20 P=2ES. Code snippet: ... // In-Session Logon to Reset Sequence Number FIX::Message logon =3D message; logon.getHeader().setField( FIX::MsgType( FIX::MsgType_LOGON ) ); logon.setField( FIX::EncryptMethod( 0 ) ); logon.setField( FIX::HeartBtInt( 30 ) ); FIX::ResetSeqNumFlag resetSeqNumFlag=3D"Y"; logon.setField (resetSeqNumFlag); logon.getHeader().setField(FIX::MsgSeqNum(1)); get_session() -> setNextTargetMsgSeqNum(0); get_session() -> setNextSenderMsgSeqNum(1); get_session() -> send(logon); _______________________________________________________________________ This E-Mail (including any attachments) may contain privileged or confident= ial information. It is intended only for the addressee(s) indicated above. The sender does not waive any of its rights, privileges or other protection= s respecting this information. =20 Any distribution, copying or other use of this E-Mail or the information it= contains, by other than an intended recipient, is not sanctioned and is pr= ohibited. If you received this E-Mail in error, please delete it and advise the sende= r (by return E-Mail or otherwise) immediately. This E-Mail (including any attachments) has been scanned for viruses.=20 It is believed to be free of any virus or other defect that might affect an= y computer system into which it is received and opened.=20 However, it is the responsibility of the recipient to ensure that it is vir= us free.=20 The sender accepts no responsibility for any loss or damage arising in any = way from its use. E-Mail received by or sent from RBC Capital Markets is subject to review by= Supervisory personnel.=20 Such communications are retained and may be produced to regulatory authorit= ies or others with legal rights to the information. |