Re: [Quickfix-developers] empty sequence number on sequence reset message
Brought to you by:
orenmnero
From: Oren M. <or...@qu...> - 2004-11-04 15:54:21
|
Well, when a sequence reset is sent in reset mode (123=3DN) the spec = says=20 that you should ignore the MsgSeqNum. I guess Appia took this to mean=20= that they can choose to just not send it, even though it is listed as a=20= required field (not conditionally required) in the standard header. First thing that we should do is have QF gracefully handle rejecting a=20= message without a sequence number. This should be accomplished easily=20= enough by replacing that line with this: if( message.getHeader().isSetField( msgSeqNum ) ) message.getHeader().getField( msgSeqNum ); This will essentially cause the reject message to say it is rejecting=20 the message with sequence number 0, which I think is a reasonable thing=20= to say if there is no sequence number. Now the question is do we want to make an exception for this message=20 type and process the message that doesn't contain this required field. =20= I would say since it is our job to "ignore" it, than yes, we should=20 probably allow it. To accomplish this we will need to allow the=20 nextSequenceReset method to specify that the validate method should=20 ignore sequence numbers. We can probably do this by rewriting the=20 method like so: bool Session::verify( const Message& msg, bool checkTooHigh, bool checkTooLow, bool checkSequenceNumber ) { QF_STACK_PUSH(Session::verify) SenderCompID senderCompID; TargetCompID targetCompID; SendingTime sendingTime; MsgType msgType; MsgSeqNum msgSeqNum; try { const Header& header =3D msg.getHeader(); header.getField( senderCompID ); header.getField( targetCompID ); header.getField( sendingTime ); header.getField( msgType ); if( checkSequenceNumber ) header.getField( msgSeqNum ); if ( !validLogonState( msgType ) ) throw std::logic_error( "Logon state is not valid for message" ); if ( !isGoodTime( sendingTime ) ) { doBadTime( msg ); return false; } if ( !isCorrectCompID( senderCompID, targetCompID ) ) { doBadCompID( msg ); return false; } if ( checkSequenceNumber && checkTooHigh && isTargetTooHigh(=20 msgSeqNum ) ) { doTargetTooHigh( msg ); return false; } else if ( checkSequenceNumber && checkTooLow && isTargetTooLow(=20 msgSeqNum ) ) { doTargetTooLow( msg ); return false; } UtcTimeStamp now; m_state.lastReceivedTime( now ); m_state.testRequest( 0 ); } catch ( std::exception& e ) { m_state.onEvent( e.what() ); disconnect(); return false; } fromCallback( msgType, msg, m_sessionID ); return true; QF_STACK_POP } On Nov 4, 2004, at 8:33 AM, Michael Raykh wrote: > In our test of quickFix against Appia fix engine the following = happens: > > - Appia sends sequence reset request msg > - for some reason sequence number field is not populated on this reset=20= > request > - quickFix decides to reject this > - crashes in generateReject in > =A0=A0=A0=A0=A0=A0=A0 =A0 message.getHeader().getField( msgSeqNum ); > =A0=A0 'cause message seq number is not set... > > > > Is this proper behaviour? Any suggestions how to handle this? > This email and any files transmitted with it are confidential and=20 > intended solely for the use of the individual or entity to whom they=20= > are addressed. If you have received this email in error please notify=20= > the system manager. This message contains confidential information and=20= > is intended only for the individual named. If you are not the named=20 > addressee you should not disseminate, distribute or copy this e-mail.=20= |