FIX 4.4 Connection: Logon Process¶
The Logon process is the first step in establishing a FIX session between two counterparties (client and server).\ It ensures that both sides agree on session parameters and synchronize message sequence numbers.
Logon Message (MsgType = A)¶
A Logon message must be the first message sent by each side when initiating a FIX session.
Example¶
8=FIX.4.4|9=75|35=A|34=1|49=CLIENT1|56=BROKER1|52=20250912-15:40:00.000|
98=0|108=30|141=Y|553=100000|554=Secret123|10=128|
Key Fields¶
- 35=A -- MsgType = Logon\
- 34 -- MsgSeqNum, first message in the session (typically
1)\ - 49 -- SenderCompID (client ID)\
- 56 -- TargetCompID (server/broker ID)\
- 52 -- SendingTime\
- 98 -- EncryptMethod (0 = None, 1 = PKCS, etc.)\
- 108 -- HeartBtInt (heartbeat interval in seconds)\
- 141 -- ResetSeqNumFlag (Y = reset sequence numbers, N = continue)\
- 553 -- Username (required by brokers)\
- 554 -- Password (required by brokers)
Logon Workflow¶
- Initiator (client) sends Logon message with session parameters.\
- Acceptor (server/broker) replies with its own Logon message.\
- If both sides accept, the session is established.\
- Heartbeats (
35=0) begin at intervals defined by 108=HeartBtInt.\ - Trading messages (orders, executions, etc.) can be exchanged.
Session Management Considerations¶
- Both sides must maintain message sequence numbers (
34).\ - If numbers are out of sync, the Resend Request (2) is used.\
- Heartbeats ensure connectivity; if not received within timeout, the session is terminated.\
- To close the session properly, the Logout (5) message is used.
Example Logon Exchange¶
Client → Server
8=FIX.4.4|9=75|35=A|34=1|49=CLIENT1|56=BROKER1|52=20250912-15:40:00.000|98=0|108=30|141=Y|10=128|
Server → Client
8=FIX.4.4|9=75|35=A|34=1|49=BROKER1|56=CLIENT1|52=20250912-15:40:00.500|98=0|108=30|141=Y|10=129|
At this point, the FIX session is active and ready for message exchange.
Best Practices¶
- Always reset sequence numbers (
141=Y) at the start of a new day/session.\ - Ensure accurate system time synchronization (NTP).\
- Protect credentials (553/554) -- use secure transport if possible.\
- Log all session messages for audit and troubleshooting.