Thread: [Quickfix-users] .Net SessionFactory
Brought to you by:
orenmnero
From: EclipseCap <tob...@ec...> - 2009-03-04 17:01:17
|
As a pure exercise I am trying to build a new session without the use of the config file ala "settings = new SessionSettings("myconfig1.cfg");". From the reading I have done on this site it appears that SessionFactory is the way to do this. However, I don't see session factory as a usable class. Am I missing it somewhere? Can a new session object be created in some other fashion? Has it not been written yet? A point in the right direction would be of great assitance. Thanks, -- View this message in context: http://www.nabble.com/.Net-SessionFactory-tp22334417p22334417.html Sent from the QuickFIX - User mailing list archive at Nabble.com. |
From: Malinka R. <ael...@gm...> - 2009-03-04 17:15:32
|
You can directly replace the ConfigFile with an incode setting of Settings using SessionSettings http://quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_session_settings.html and Dictionary http://quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_dictionary.html where you would set your setings in the dictionary (key/value pair) and then set the settings to the SessionSettings with a sesion or as the default settings, you would need to then create your own SessionID http://quickfixengine.org/quickfix/doc/html/class_f_i_x_1_1_session_i_d.html and then when creating your initiator/acceptor instead of using the SessionSettings you would have created which load the config file you just use the SessionSettings object you just created and set the settings to On Wed, Mar 4, 2009 at 12:01, EclipseCap <tob...@ec...> wrote: > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > > > As a pure exercise I am trying to build a new session without the use of the > config file ala "settings = new SessionSettings("myconfig1.cfg");". From > the reading I have done on this site it appears that SessionFactory is the > way to do this. However, I don't see session factory as a usable class. > > Am I missing it somewhere? Can a new session object be created in some > other fashion? Has it not been written yet? > > A point in the right direction would be of great assitance. > > Thanks, > > > -- > View this message in context: http://www.nabble.com/.Net-SessionFactory-tp22334417p22334417.html > Sent from the QuickFIX - User mailing list archive at Nabble.com. > > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise > -Strategies to boost innovation and cut costs with open source participation > -Receive a $600 discount off the registration fee with the source code: SFAD > http://p.sf.net/sfu/XcvMzF8H > _______________________________________________ > Quickfix-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-users > |
From: Alain T. <a....@ne...> - 2009-03-04 17:33:11
|
Hi, instead of using a config file, you can set the properties by code: sessionSettings = new SessionSettings(); QuickFix.Dictionary DefaultDic = sessionSettings.get(); // Global settings DefaultDic.setString("OdbcDataBase", db); // ... // Settings for another session QuickFix.Dictionary dic = new Dictionary(); dic.setString("SocketConnectHost", source.ConnectHost); // ... SessionID sid = new SessionID( new BeginString(beginString), new SenderCompID(source.SenderCompID), new TargetCompID(source.TargetCompID), qualifier); sessionSettings.set(sid, dic); -----Message d'origine----- De : EclipseCap [mailto:tob...@ec...] Envoyé : mercredi 4 mars 2009 18:01 À : qui...@li... Objet : [Quickfix-users] .Net SessionFactory QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html QuickFIX Support: http://www.quickfixengine.org/services.html As a pure exercise I am trying to build a new session without the use of the config file ala "settings = new SessionSettings("myconfig1.cfg");". From the reading I have done on this site it appears that SessionFactory is the way to do this. However, I don't see session factory as a usable class. Am I missing it somewhere? Can a new session object be created in some other fashion? Has it not been written yet? A point in the right direction would be of great assitance. Thanks, -- View this message in context: http://www.nabble.com/.Net-SessionFactory-tp22334417p22334417.html Sent from the QuickFIX - User mailing list archive at Nabble.com. ------------------------------------------------------------------------------ Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise -Strategies to boost innovation and cut costs with open source participation -Receive a $600 discount off the registration fee with the source code: SFAD http://p.sf.net/sfu/XcvMzF8H _______________________________________________ Quickfix-users mailing list Qui...@li... https://lists.sourceforge.net/lists/listinfo/quickfix-users |
From: EclipseCap <tob...@ec...> - 2009-03-04 20:03:06
|
For those following in my footsteps here is the code I wrote that answered my initial question. Many thanks to Alain and Malinka for their help. SessionSettings settings; FixApplication application; FileStoreFactory storeFactory; MessageFactory messageFactory; SocketInitiator initiator; //------------------------------------------------------------------------------------- // Get all of the QuickFix variables setup. //------------------------------------------------------------------------------------- settings = new SessionSettings(); QuickFix.Dictionary defaultDic = settings.get(); //------------------------------------------------------------------------------------- // Set all of the values as you would get them from your config file //------------------------------------------------------------------------------------- defaultDic.setString("ConnectionType", "initiator"); defaultDic.setString("HeartBtInt", "30"); defaultDic.setString("ReconnectInterval", "1"); defaultDic.setString("FileStorePath", "store"); defaultDic.setString("FileLogPath", "log"); defaultDic.setString("StartTime", "00:00:00"); defaultDic.setString("EndTime", "00:00:00"); defaultDic.setString("UseDataDictionary", "N"); defaultDic.setString("HttpAcceptPort", "8081"); //------------------------------------------------------------------------------------- // Set the session dependant stuff. //------------------------------------------------------------------------------------- SessionID sID = new SessionID(new BeginString("FIX.4.2"), new SenderCompID("CLIENT1"), new TargetCompID("ORDERMATCH")); defaultDic.setString("SocketConnectHost", "localhost"); defaultDic.setString("SocketConnectPort", "5002"); settings.set(sID, defaultDic); sID = new SessionID(new BeginString("FIX.4.2"), new SenderCompID("CLIENT2"), new TargetCompID("ORDERMATCH")); defaultDic.setString("SocketConnectHost", "localhost"); defaultDic.setString("SocketConnectPort", "5002"); settings.set(sID, defaultDic); application = new FixApplication(); storeFactory = new FileStoreFactory(settings); messageFactory = new DefaultMessageFactory(); initiator = new SocketInitiator(application, storeFactory, settings, messageFactory); initiator.start(); -- View this message in context: http://www.nabble.com/.Net-SessionFactory-tp22334417p22338072.html Sent from the QuickFIX - User mailing list archive at Nabble.com. |