<p dir="ltr">One idea is to make a separate log file just for FIX messages. At end of day you then run a batch job to import messages to DB.</p>
<div class="gmail_quote">On Apr 15, 2016 1:54 PM, "Grant Birchmeier" <<a href="mailto:gbirchmeier@connamara.com">gbirchmeier@connamara.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small;color:#000000">This is not a built-in feature.  I'm not sure if it should be.</div><div class="gmail_default" style="font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-size:small;color:#000000">My key piece of advice would be: <b>Do not do the DB save on the QF callback thread!</b>  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.)</div><div class="gmail_default" style="font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-size:small;color:#000000">(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.)</div><div class="gmail_default" style="font-size:small;color:#000000"><br></div><div class="gmail_default" style="font-size:small;color:#000000">Other advice:</div><div class="gmail_default"><ul><li>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.</li><li>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.</li></ul><div>-Grant</div><div><br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 14, 2016 at 11:24 AM, James A. Smith <span dir="ltr"><<a href="mailto:jsmith@anstca.com" target="_blank">jsmith@anstca.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-US" link="blue" vlink="purple">
<div>
<p class="MsoNormal">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?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">James <u></u><u></u></p>
</div>
</div>

<br>_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com" target="_blank">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" rel="noreferrer" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div><div><font size="2"><span style="background-color:#000000"><span style="background-color:#ffffff">Grant Birchmeier</span></span></font><font size="2"><font color="#3333ff"><br></font></font></div><div><font size="2"><b><font color="#3333ff"><span style="background-color:#ffcc33"><span style="background-color:#ffcc66"><span style="background-color:#ffcc99"><span style="background-color:#ffffff"><span style="background-color:#ffcc00">Connamara Systems, LLC</span></span></span></span></span></font></b></font><br></div><div><font size="2"><b>Made-To-Measure Trading Solutions.</b></font></div><div><font size="2">Exactly what you need. No more. No less.</font><font size="2"><b><font color="#3333ff"><br></font></b></font></div><div><font size="2"><a href="http://connamara.com" target="_blank">http://connamara.com</a><br></font></div></div>
</div>
<br>_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" rel="noreferrer" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><br>
<br></blockquote></div>