Re: [Quickfix-developers] Waiting for automatic ResendRequest to finish?
Brought to you by:
orenmnero
|
From: Dale W. <wil...@oc...> - 2006-02-20 14:16:27
|
Hi Eddie Edde wrote: > Since it needed to resend 50000 messages this takes some time and > while this is in progress our system continues the startup process. > I'm planning to rewrite this code ASAP but at the moment what we do > after a major crash on either end is to clear all our databases and > send a ResendRequest demanding all messages sent in the session: The problem is that a ResendRequest is an administrative-level message and you are attempting to use it for an application-level purpose. TCP/IP will resend packets on occasion as part of it's error recovery, but no one attempts to use this information to "replay" a TCP/IP session. THe same should be true for FIX. Communication stacks work because the layers are kept distinct --- each one serving it's own purpose and interactinint with the layers above and below it through a well specified API. Unfortunately in FIX the two layers, admin and app, are not so clearly delineated and it tempts developers to cross the line. This is not the first time I have seen someone trying to use a ResendRequest for this purpose. QuickFIX takes care of the administrative layer of the protocol for you, but if your application sends its own admin layer messages that QuickFIX doesn't know about, it gets confused (and rightly so!) You might be able to come up with a hack that works for this particular version of QuickFIX, but what ever you come up with there's no guarantee that it will work correctly in future versions of QuickFIX. That gets us to the question of, "what's the *right* way to fix this problem.. Solution #1: read the day's messages fom the store or from the log and reprocess them. . Solution #2: define a "retransmit today's transactions" message. You might define a new custom message type, or consider "twisting" an application level message for this purpose. (How about using "wildcard" order id's in an order status request.? ) You could even define an "End of retransamint" application level message (or field within a message). This, of course, assumes you have some influence on the software at the other end of the connection. Note that "misusing" an application level message is much less of a sin than subverting an Admin message. Among other things it won't confuse QuickFIX. Solution #3: Trick QuickFIX into sending the resend request you need -- reset the expected incoming sequence number to 1 without chaning the next sequence number to send. Do this before loggin in so only one "resed" will happen. Dale -- ----------------------------------------------------- Dale Wilson, Senior Software Engineer Object Computing, Inc. (OCI) http://www.ociweb.com/ http://www.theaceorb.com/ ---------------------------------------------------- |