A modern reference project demonstrating how to set up, configure, and run a QuickFIX engine connection using Python. This repository includes both an Acceptor (Server) and an Initiator (Client) session configured to connect and exchange FIX messages.
├── acceptor/ # Acceptor (Server) Application
│ ├── Dockerfile # Optimized Docker configuration for Server
│ ├── server.py # Entry point for Server
│ ├── server.cfg # Server configuration
│ ├── application.py # Server session logic (QuickFIX Application)
│ └── start.sh # Acceptance startup script
├── initiator/ # Initiator (Client) Application
│ ├── Dockerfile # Optimized Docker configuration for Client
│ ├── client.py # Entry point for Client
│ ├── client.cfg # Client configuration
│ ├── application.py # Client session logic (QuickFIX Application)
│ └── start.sh # Initiation startup script
├── docker-compose.yml # Multi-container orchestration
├── requirements.txt # Project dependencies
└── README.md # Documentation
- Python 3.10 (Recommended)
- Docker & Docker Compose (Optional, but highly recommended for containerized setup)
- System C++ compilation tools (only needed if compiling from source on local terminal)
Choose one of the following methods to run the project:
Docker Compose orchestrates both Acceptor and Initiator containers automatically.
-
Create Environment Configuration: Create a
.envfile in the root directory:APP_PORT=3000 WORKING_DIR=/app
-
Start the Services: Run Docker Compose to build and start the containers:
docker compose up --build
-
Interactive Control & Logging:
- To view real-time logs:
docker compose logs -f
- To open an interactive shell inside the Initiator container:
docker exec -it quickfix_initiator bash docker exec -it quickfix_acceptor bash
- To view real-time logs:
If you prefer to run the components directly on your machine:
-
Install Dependencies: Ensure you use virtual environments to install dependencies.
python -m venv .venv source .venv/bin/activate # On Windows: .venv\Scripts\activate pip install -r requirements.txt
[!TIP] We use
quickfix-binaryinrequirements.txtto install precompiled wheels. This skips the long, resource-intensive C++ compilation process! -
Prepare Session Storage: Create a folder to store session state files:
rm -rf ./Sessions && mkdir -p ./Sessions && chmod 755 ./Sessions
-
Run the Acceptor (Server) First: Navigate to the acceptor directory and run:
cd acceptor python server.py server.cfg -
Run the Initiator (Client): Open a new terminal session, activate your virtual environment, and run:
cd initiator python client.py client.cfg
Important
Startup Order: Always start the Acceptor server first. The Initiator client will continuously attempt to connect once active.
This repository contains optimization features designed to speed up the developer workflow:
- Precompiled Binaries: By utilizing
quickfix-binaryinstead of standardquickfix, we bypass C++ compilation during dependency sync, reducing installation time from 15 minutes to under 7 seconds. - Optimized Docker Cache:
Dockerfilelayer ordering ensures dependencies are cached. Modifying application code in./acceptoror./initiatorwill result in near-instant incremental rebuilds (<1s). - Shared Cache: When building with Docker Compose, the second stage reuses the cached virtual environment from the first stage, reducing fresh build times.
- QuickFIX Configuration Guide: Read the official QuickFIX Configuration Reference to customize sessions, heartbeats, logs, and transport details.
- Author: Rin Le (<rinle[dot]it[at]gmail.com>)