Technology Corner

Home » DotNet » QuickFix: Connect multiple FIX sessions with Fix Server

QuickFix: Connect multiple FIX sessions with Fix Server

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 80 other followers

Twitter updates


RSS InfoQ Feeds

  • First Pedestrian Killed by Self-Driving Car
    A pedestrian was killed on Sunday evening in Tempe, Arizona by a self-driving car operated by Uber, the BBC reports. The firm confirmed that the vehicle was traveling in autonomous mode with a safety driver, the only vehicle occupant, behind the wheel during the crash. By Roland Meertens
  • Microsoft Embeds Artificial Intelligence in Windows 10 Update
    The next Windows 10 update opens the way for the integration of artificial intelligence functionalities within Windows applications. Developers will be able to integrate pre-trained deep-learning models converted to the ONNX framework in their Windows applications. By Alexis Perrier
  • Ankyra Presents “Escape”, a Release Automation Tool that Manages Platforms as Logical Components
    Over the last ten years there has been increased focus on infrastructure as code (IaC) tooling, primarily driven by the rise of Infrastructure as a Service (IaaS) and API-driven infrastructure. InfoQ discussed the challenges of homogenising this tooling with Bart Spaans, founder of Ankyra, who is an expert in the domain of infrastructure and release engineer […]
  • Article: Servlet and Reactive Stacks in Spring Framework 5
    Spring Framework 5 supports both traditional servlet-based and reactive web stacks, in the same server application, reflecting a major shift towards asynchronous, non-blocking concurrency in applications. In this article Spring committer Rossen Stoyanchev explores and contrasts both stacks, and explains the range of available choices, and provides guidance f […]
  • Presentation: Elm and Game Development, a Perfect Fit
    Paulo Diniz discusses the Elm architecture, how to use it as functional reactive programming for web game development. By Paulo Diniz
  • Google Releases “Skaffold”, a Tool That Facilitates Continuous Development with Kubernetes
    Google has released Skaffold, an open source command line tool that facilitates continuous development for Kubernetes applications. Skaffold is entering an increasingly crowded space of Kubernetes development automation tooling, including Azure’s Draft, Datawire’s Forge and Weavework’s Flux. By Daniel Bryant
  • Q&A with Marisa Fagen on Security Championship
    Security lead Marisa Fagen recently spoke at QConLondon 2018 about upskilling and elevating engineering team members into the role of Security Champions. We catch up with Fagen and report on her efforts to address contention caused by a scarcity of security professionals. By Rafiq Gemmail
  • GitHub Licensed Aims to Make it Easier to Comply with OSS Licenses
    GitHub Licensed is an open-source tool that aims to simplify the chore of ensuring license soundness and documentation for all dependencies of a GitHub project. By Sergio De Simone
  • Sauce Labs Adds Analytics and Extended Debugging to Continuous Testing Cloud
    At their recent user conference SauceCon, Sauce Labs introduced new capabilities for its continuous testing cloud including test analytics, featuring a dashboard that analyses test results and exposes common failures by browser and operating system, including Android and iOS. By Helen Beal
  • JavaFX and the Future of Java Client Technologies
    Oracle will remove JavaFX, Applets and Java Web Start from the JDK after Java SE 8. Swing and AWT will remain. By Tim Hodkinson


This post will describe how we can connect multiple sessions with Fix Server. I’ll take example to connect Trade session and data session. Trade session is to send orders whereas data session is to get market prices from server.

To connect any Fix server we need to have some mandatory configuration like sender information, target information, server to connect, port, fix protocol version, connection type etc.

Below is table of mandatory configuration to connect Fix server:


Config Fields Description
ConnectionType it is to tell QuickFix engine it is acceptor (listener) or initiator(client).
BeginString Fix Protocol version eg. FIX.4.2
TargetCompID Target Server Id to connect
SenderCompID sender ID which will send message to target comp id
SocketConnectHost Fix Server IP address
SocketConnectPort Port to connect
Password Password to connect if needed


To start any session with Fix server, there should be one class which will be inherited by QuickFix.Application base class.

Steps to connect Fix Server




Step 1: Add session information in Config file



#trade session

#data session


Step 2: Load config file

var settings = new SessionSettings(config);
FileStoreFactory storeFactory = new FileStoreFactory(settings);
ScreenLogFactory logFactory = new ScreenLogFactory(settings);
QuickFix42.MessageFactory messageFactory = new QuickFix42.MessageFactory();

Step 3: Initiate Socket Initiator


SocketInitiator initiator = new SocketInitiator(ClientInitiator, storeFactory,

settings, logFactory, messageFactory);

Step 4: Connect

To connect to Fix Server you need to call Start  method of SocketInitiator class.



Step 5: Enrich Logon message with mandatory fields

Before sending logon message to Fix server you need to fill some mandatory information. You can capture all the messages before sending to Fix server in toAdmin method in QuickFix.Application class (I have ClientInitiator class which is derive from QuickFix.Application class).

public void toAdmin(QuickFix.Message value, QuickFix.SessionID session)
            if (value is QuickFix42.Logon)
               var logon = (QuickFix42.Logon)value;
               logon.set(new EncryptMethod(0));
               logon.set(new HeartBtInt(30));
               logon.setString(554,"abc"); //set password
               logon.set(new ResetSeqNumFlag(true));//reset sequence of messages


Step 6:  Response from server

After sending logon message to server, server authenticate this message and sends response either Logon or LogOut message.

You can capture relevant messages and can keep status of each session. Sever should send failure reason in case of logout message (message type 5). you can get it from field type “text (58)”.


 public override void onMessage(QuickFix42.Logon message, SessionID session)
          if (_sessionMap.ContainsKey(session.getSenderCompID()))
            _sessionMap[session.getSenderCompID()].Status = "Connected";

 public override void onMessage(QuickFix44.Logout message, SessionID session)
         if (_sessionMap.ContainsKey(session.getSenderCompID()))
           _sessionMap[session.getSenderCompID()].Status = "Disconnected";


I used same code base which I used in my previous post “basic fix message implementation using quickfix”. You can download code from this post and can apply below code in it. Please let me know if you still face any problem to implement above steps.

Happy Coding Smile


  1. Joerg Klein says:

    It is possible to wrie this example in C++ for Linux (Debian)? This would be great.
    Thank you for your help.


  2. says:

    I am sendig Logon request in wireshark it display me as fix packet but which we check the financal information error. Due error/messing missing beginString filed.
    [Missing BeginString field]
    [Severity level:error]

    Can you please help how can i resolve this.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blogs I Follow

%d bloggers like this: