Re: [Quickfix-developers] Delay processing of FIX messages
Brought to you by:
orenmnero
|
From: Caleb E. <cal...@gm...> - 2006-10-06 15:41:49
|
On 10/6/06, Nick Volpe <ni...@ad...> wrote: > But as soon > as database connectivity is back, I'd like to start processing all of the > FIX messages that have not yet been processed. What is the best way to do > this? Well, since you seem to have enough control over the database connection to know when it is up/down, you might want to keep a queue of FIX messages yet-to-be-processed. Your Application callback methods can put messages in that queue when the DB connection is down, and when the connection has come back up you can drain it. The only problem with this scenario is what happens if your app crashes while the DB connection is down and messages are in your queue. They will be lost, since QuickFIX will think you have already processed them because the callback has already returned. To do it right, you'd need to make this queue persistent or you'd need to keep track of the last message you successfully wrote to the DB and reset the QuickFIX incoming sequence number to match when your app starts up. -- Caleb Epstein |