Click here to Skip to main content
13,042,630 members (84,256 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as

Stats

20.3K views
Posted 1 Mar 2012

How to create dynamic FIX sessions using Quick Fix

, 1 Mar 2012
Rate this:
Please Sign up or sign in to vote.
Dynamic creation of Fix sessions
I am explaining about how we can create sessions dynamically through code using QuickFix. My earlier examples were using configuration files. But we can also create session dynamically, this might be helpful when application maintains many sessions, so we can keep session metadata information in xml or database to track or maintain sessions.

You can find code which describe fix initiator and fix acceptor in my earlier post.

Below is code which creates multiple listener sessions in Fix Acceptor:

SessionSettings settings = new SessionSettings();
 
                SessionID id1 = new SessionID(new BeginString("FIX.4.2"), 
			new SenderCompID("FixServer"), 
			new TargetCompID("Client1"), "Session1");
                Dictionary d = new Dictionary();
 
                d.setString("ConnectionType", "acceptor");
                d.setLong("SocketAcceptPort", 5001);
                d.setString("FileLogPath", "Log");
                d.setString("StartTime", "00:00:00");
                d.setString("EndTime", "00:00:00");
                d.setString("FileStorePath", @"c:\fixfiles");
                d.setBool("UseDataDictionary", true);
                d.setString("DataDictionary", @"FIX42.xml");
 
                settings.set(id1,d);
 
                id1= new SessionID(new BeginString("FIX.4.2"), 
			new SenderCompID("FixServer"), 
			new TargetCompID("Client2"), "Session2");
                d = new Dictionary();
 
                d.setString("ConnectionType", "acceptor");
                d.setLong("SocketAcceptPort", 5001);
                d.setString("FileLogPath", "Log");
                d.setString("StartTime", "00:00:00");
                d.setString("EndTime", "00:00:00");
                d.setString("FileStorePath", @"c:\fixfiles");
                d.setBool("UseDataDictionary", true);
                d.setString("DataDictionary", @"FIX42.xml");
 
                settings.set(id1, d);
 
                                                
                FixServerApplication application = new FixServerApplication();
                FileStoreFactory storeFactory = new FileStoreFactory(settings);
                ScreenLogFactory logFactory = new ScreenLogFactory(settings);
                MessageFactory messageFactory = new DefaultMessageFactory();
                SocketAcceptor acceptor
                  = new SocketAcceptor(application, storeFactory, settings, 
			logFactory, messageFactory);
 
                acceptor.start();
                Console.WriteLine("press  to quit");
                Console.Read();
                acceptor.stop();


SessionSettings instance accepts dictionary object and SessionID to create new session. Dictionary class maintain key value pair. We can find more about FIX configuration details here.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Neeraj Kaushik1980
Architect Saxo Bank A/S
Denmark Denmark
• Solution Architect /Principle Lead Developer with 12 years of IT experience with more emphasize on Capital Domain and Investment banking domain.
• Strong experience in Continuous Integration, Delivery and DevOps solutions.
• Strong experience in drafting solutions, stakeholder communications and risk management.
• Proved strong coding and designing skills with agile approaches (TDD, XP framework, Pair Programming).
• Delivered many projects with involvement from inception to delivery phase.
• Strong experience in high performance, multithreaded, low latency applications.
• Ability to communicate with the business and technical stake holders effectively.
• Have extensive experience in Capital Market Domain: Front Office & BackOffice (Algorithm Trading tools, messaging framework, Enterprise bus, integration of FIX APIs and many trading APIs).
• Functional knowledge of Portfolio/Wealth Management, Equities, Fixed Income, Derivatives, Forex.
• Practical knowledge of building and practicing agile delivery methodologies (SCRUM, TDD, Kanban).

Technical Skills

• Architectural: Solution Design, Architectural Presentations (Logical, Component, Physical, UML diagrams)
• Languages: C#, C++
• Server Technologies: WCF, Web API,
• Middle Ware: ActiveMQ, RabbitMQ, Enterprise Service Bus
• UI Technologies: Winforms and WPF
• Web Technologies: Asp.Net Mvc, KnockOutJS, JQuery, Advance Java Scripts Concepts
• Databases: Sql Server 2008 +, MySQL
• Tools/Frameworks: TFS, SVN, NUnit, Rhino Mocks, Unity, NAnt, QuickFix/n, Nhibernate, LINQ, JIRA,

Functional Skills

• Wealth Management System, Trade Life Cycle, Trading Components and their integrations
• Working knowledge of Stocks, Bonds, CFDs,Forex, Futures and Options
• Pricing Systems, Market Data Management,
• BackOffice Processes : Settlement Processes, Netting, Tax, Commissions, Corporate Actions Handling,
• Reporting Solutions : OLTP and OLAP Data model designing
• FIX Engine implementation and integration

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralMy vote of 3 Pin
Pradeep Manohar20-Jan-15 9:10
memberPradeep Manohar20-Jan-15 9:10 
QuestionSingle quickfix session for sending and receivng messages ? Pin
Member 310194110-Feb-14 7:51
memberMember 310194110-Feb-14 7:51 
AnswerRe: Single quickfix session for sending and receivng messages ? Pin
Neeraj Kaushik 198010-Feb-14 8:08
memberNeeraj Kaushik 198010-Feb-14 8:08 
QuestionSuggestions for sending and receiving messages using QuickFix Pin
Member 310194129-Jan-14 5:33
memberMember 310194129-Jan-14 5:33 
AnswerRe: Suggestions for sending and receiving messages using QuickFix Pin
Neeraj Kaushik 198029-Jan-14 11:34
memberNeeraj Kaushik 198029-Jan-14 11:34 
QuestionBroken Link Pin
MalcolmCudworth20-Apr-12 0:57
memberMalcolmCudworth20-Apr-12 0:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.170713.1 | Last Updated 1 Mar 2012
Article Copyright 2012 by Neeraj Kaushik1980
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid