Re: [Quickfix-developers] manually controlling last-accepted sequence number
Brought to you by:
orenmnero
From: Fabio.Andrade <fan...@gm...> - 2009-06-08 17:29:42
|
Hello Rick, You only need to save the last sequence number that you processed and then you can change (before the application has been stablished the logon) the incoming sequence number to this value. See the code below: //This is the field that contains the last fix sequence number processed by your logical layer. private int lastFixSeqProcessed = 0; //This function is from QuickFIX Application interface. You must to implement it in your derived class. public void onCreate(QuickFix.SessionID __p1) { // Here you are informing QuickFix that your next incoming fix sequence number is the // last fix sequence number that you have been processed. You need to add 1, because the // last fix sequence number that you have, already has been processed. QuickFix.Session.lookupSession(__p1).setNextTargetMsgSeqNum(lastFixSeqProcessed + 1); } Best regards. Rick Lane-2 wrote: > > QuickFIX Documentation: > http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > Greetings, > Given the architecture of our trading platform, and because there is a > separate thread that handles SQL Server database backup (audit trail, > order > management, etc.) it is possible for QuickFix to receive a message from > our > counterparty, hand the message off to my application and then log the fact > that sequence number X was received and processed. However, before I > apply > the business logic of this particular message (which includes updating the > database), it is possible for the application to close ungracefully. When > I > log back in to the counterparty, QuickFix will not ask for a resend for > the > messages that we received but didn't "process" at the application level. > For instance: > > 1) QuickFix receives/delivers msg #10 > 2) QuickFix receives/delivers msg #11 > 3) QuickFix receives/delivers msg #12 > 4) I process/store msg #10 > 5) QuickFix receives/delivers msg #13 > 6) I process/store msg #11 > 7) CRASH > > When I log in again: > > 1) QuickFix receives msg #25 > 2) QuickFix issues resend request for msgs #14-24 > > Here, QuickFix thought we already got messages 12 and 13 (which > technically > we did, but I was unable to apply their business logic to the database). > > What I'm wondering is if there is any way I can manually update the > QuickFix > engine each time I "process" (persist) a message, telling it that the > message was completely processed, so it does not need to request it in the > event of a message sequence gap. > > Thanks, > Rick > > ------------------------------------------------------------------------------ > Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT > is a gathering of tech-side developers & brand creativity professionals. > Meet > the minds behind Google Creative Lab, Visual Complexity, Processing, & > iPhoneDevCamp as they present alongside digital heavyweights like > Barbarian > Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > -- View this message in context: http://www.nabble.com/manually-controlling-last-accepted-sequence-number-tp23743256p23928644.html Sent from the QuickFIX - Dev mailing list archive at Nabble.com. |