{{Quickfixn}} Persisting messages in the DB

James A. Smith jsmith at anstca.com
Mon Apr 18 06:18:05 PDT 2016


Thank you Grant, that is exactly what I’m doing using BlockingCollection.  I just wanted to make sure I was not re-inventing the wheel.

From: Quickfixn [mailto:quickfixn-bounces at lists.quickfixn.com] On Behalf Of Grant Birchmeier
Sent: Friday, April 15, 2016 2:54 PM
To: Mailing list for QuickFIX/n
Subject: Re: {{Quickfixn}} Persisting messages in the DB

This is not a built-in feature.  I'm not sure if it should be.

My key piece of advice would be: Do not do the DB save on the QF callback thread!  Implement a work queue.  When a message comes in that you want to save, have your OnMessage(x) method save it in that queue.  A separate DB-writer thread should block on that queue and pop messages off to save them in the DB.  (If you search for C# BlockingQueue, you'll find some samples.)

(QF callbacks are single-threaded.  If any of them take a long time doing something (like, say, doing DB stuff), they'll cause the engine's message queue to get backed up and you'll eventually disconnect because of lag.)

Other advice:

  *   Do your DB-work-queue pushes in OnMessage() callbacks.  I don't see a good reason to do it in FromApp(), unless you are sure you really want all messages of all types.
  *   If it's a market data connection, ABORT ABORT!  Too much data, and old data is not useful anyway.  There's no reason to save this stuff.
-Grant


On Thu, Apr 14, 2016 at 11:24 AM, James A. Smith <jsmith at anstca.com<mailto:jsmith at anstca.com>> wrote:
I’m new to QuickFix.  I need a way to persist all messages into the DB.  Can QuickFix/N do this out of the box?  If so, can you point me to examples or documentation for this?  I can’t seem to find anything?

Thanks,
James

_______________________________________________
Quickfixn mailing list
Quickfixn at lists.quickfixn.com<mailto:Quickfixn at lists.quickfixn.com>
http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com



--
Grant Birchmeier
Connamara Systems, LLC
Made-To-Measure Trading Solutions.
Exactly what you need. No more. No less.
http://connamara.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20160418/da4d5df1/attachment-0001.htm>


More information about the Quickfixn mailing list