{{Quickfixn}} help with example storing message in database thru odbc

Andrew Rimmer andrew at outofmemory.co.uk
Wed Oct 22 00:17:54 PDT 2014


I just created a LogFactory that saves the messages to the database. I do load the text into a message again so that I can store some of the message as fields in the database

Sent from my iPhone

> On 21 Oct 2014, at 21:40, Alberto Honorato <honorabetto at gmail.com> wrote:
> 
> Ok, understood, but now a question, if i want to use another application to read the messages so I can get some fields into its database, what would you suggest to implement? 
> 
> Thank you for your help.
> 
>> On Tue, Oct 21, 2014 at 3:28 PM, Grant Birchmeier <gbirchmeier at connamara.com> wrote:
>> The MessageStore and the FileStore are two completely different components.  It should be no problem for you to use one medium for the store and another for the log.
>> 
>> However, I'm concerned that you are confusing the message log with the message store.
>> 
>> The LogFactory creates two sets of files: the message log and the event log.  The message log contains every message sent and received; it is very useful to humans.  The event log contains status messages; it is kind of useful to humans sometimes.  The engine doesn't care about either log file.
>> 
>> The store is something else.  It is used internally by the engine to store session state in case of resend requests and such.  Humans should ignore it.  All other applications should ignore it too.  It is only for QF.  If you want to use a DB for the store, great, but that is not an invitation for other apps to start messing with it.
>> 
>>> On Tue, Oct 21, 2014 at 3:13 PM, Alberto Honorato <honorabetto at gmail.com> wrote:
>>> Thanks Olamide and Ruaan, I will try your suggestions, just to clarify, I want to store the messages using the IMessageStoreFactory. I am going to use a log in a file and the messages in a database. Have you seen something similar in your projects?
>>> 
>>> Thank you. 
>>> 
>>>> On Tue, Oct 21, 2014 at 3:08 PM, Ruaan Viljoen <ruaanv at gmail.com> wrote:
>>>> Hi Alberto,
>>>> 
>>>> I have a branch on my github that I just pushed some local code I had been testing recently. It's rudimentary and incomplete, but hacked it together along with some PostgreSQL derived classes in a testing environment for some performance tests. Also, it uses SqlConnection instead of OledbConnection, but you should get the gist and strip out and swap the sections you need or extend and override where appropriate.
>>>> 
>>>> I'll be finishing it off in the holiday and adding some unit tests. I'm not sure this fits with the current direction of QuickFix/n master branch currently, especially with the Logging interface discussions going on at the moment, but feel free to use it if it may help.
>>>> 
>>>> Regards,
>>>> Ruaan
>>>> 
>>>> Ruaan Viljoen
>>>> 
>>>> 
>>>>> On 18 October 2014 15:59, olamide olatunji <krazibit312 at gmail.com> wrote:
>>>>> Hi Alberto,
>>>>> Not sure the DB Logging is implemented in QuickFixN yet, but you can by implementing the ILogFactory
>>>>> 
>>>>>> On Sat, Oct 18, 2014 at 4:50 PM, Alberto Honorato <honorabetto at gmail.com> wrote:
>>>>>> Hello,
>>>>>> 
>>>>>> I am implementing a quickfix connection with .NET. Right now the messages are being saved in a text file, however for my project I need to store them into an sql server database thru ODBC. 
>>>>>> 
>>>>>> I have been searching the web to achieve this, but I wasn't able to  find any example. 
>>>>>> 
>>>>>> Could you help me with an example, similar to the code below, that stores the FIX messages into MS SQL Server?
>>>>>> 
>>>>>> Thanking in advance
>>>>>> 
>>>>>> Alberto Honorato
>>>>>> 
>>>>>> mainmethod
>>>>>> 
>>>>>> QuickFix.SessionSettingssettings= newQuickFix.SessionSettings(file);
>>>>>> TradeClientAppapplication= newTradeClientApp();
>>>>>> QuickFix.IMessageStoreFactorystoreFactory= newQuickFix.FileStoreFactory(settings);
>>>>>> QuickFix.ILogFactorylogFactory= newQuickFix.FileLogFactory(settings);
>>>>>> QuickFix.Transport.SocketInitiatorinitiator= newQuickFix.Transport.SocketInitiator(application,storeFactory,settings,logFactory);
>>>>>> 
>>>>>> Configurationfile
>>>>>> 
>>>>>> #defaultsettingsforsessions
>>>>>> [DEFAULT]
>>>>>> FileStorePath=store
>>>>>> FileLogPath=log
>>>>>> ConnectionType=initiator
>>>>>> ReconnectInterval=60
>>>>>> SenderCompID=*****
>>>>>> 
>>>>>> #sessiondefinition
>>>>>> [SESSION]
>>>>>> #inheritFileStorePath,FileLogPath,ConnectionType,ReconnectIntervalandSenderCompIDfromdefault
>>>>>> BeginString=FIX.4.4
>>>>>> TargetCompID=****
>>>>>> SenderCompID=*****
>>>>>> StartTime=01:00:00
>>>>>> EndTime=23:30:00
>>>>>> HeartBtInt=60
>>>>>> SocketConnectPort=*******
>>>>>> SocketConnectHost=********
>>>>>> DataDictionary=../../dictionary/FIX44.xml
>>>>>> FileLogPath=../../Log/LogFix.txt
>>>>>> FileStorePath=../../store
>>>>>> 
>>>>>> ================================================================================================
>>>>>> 
>>>>>> 
>>>>>> mainmethod
>>>>>> 
>>>>>> QuickFix.SessionSettings settings = new QuickFix.SessionSettings(file);
>>>>>> TradeClientApp application = new TradeClientApp();
>>>>>> QuickFix.IMessageStoreFactory storeFactory = new QuickFix.FileStoreFactory(settings);
>>>>>> QuickFix.ILogFactory logFactory = new QuickFix.FileLogFactory(settings);
>>>>>> QuickFix.Transport.SocketInitiator initiator = new QuickFix.Transport.SocketInitiator(application, storeFactory, settings, logFactory);
>>>>>> 
>>>>>> Configurationfile
>>>>>> 
>>>>>> # default settings for sessions
>>>>>> [DEFAULT]
>>>>>> FileStorePath=store
>>>>>> FileLogPath=log
>>>>>> ConnectionType=initiator
>>>>>> ReconnectInterval=60
>>>>>> SenderCompID=*****
>>>>>> 
>>>>>> # session definition
>>>>>> [SESSION]
>>>>>> # inherit FileStorePath, FileLogPath, ConnectionType, ReconnectInterval and SenderCompID from default
>>>>>> BeginString=FIX.4.4
>>>>>> TargetCompID=****
>>>>>> SenderCompID=*****
>>>>>> StartTime=01:00:00
>>>>>> EndTime=23:30:00
>>>>>> HeartBtInt=60
>>>>>> SocketConnectPort=*******
>>>>>> SocketConnectHost=********
>>>>>> DataDictionary=../../dictionary/FIX44.xml
>>>>>> FileLogPath=../../Log/LogFix.txt
>>>>>> FileStorePath=../../store
>>>>>> 
>>>>>> _______________________________________________
>>>>>> Quickfixn mailing list
>>>>>> Quickfixn at lists.quickfixn.com
>>>>>> http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Quickfixn mailing list
>>>>> Quickfixn at lists.quickfixn.com
>>>>> http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com
>>>> 
>>>> 
>>>> _______________________________________________
>>>> Quickfixn mailing list
>>>> Quickfixn at lists.quickfixn.com
>>>> http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com
>>> 
>>> 
>>> _______________________________________________
>>> Quickfixn mailing list
>>> 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
>> 
>> _______________________________________________
>> Quickfixn mailing list
>> Quickfixn at lists.quickfixn.com
>> http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com
> 
> _______________________________________________
> Quickfixn mailing list
> Quickfixn at lists.quickfixn.com
> http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20141022/cd269cc3/attachment.htm>


More information about the Quickfixn mailing list