Overview
FIX sessions can be preconfigured via FIX Antenna properties file - engine.properties. Parameters defined in engine.properties will be used during the session creation process.
To configure a session parameter just add the following line into the engine.properties file:
Session.<SessionName>.<Parameter> = <value>
<SessionName> - SessionCompID and TargetCompID separated by '/' symbol or "Default"
<Parameter> - Configurable session parameter
<Value> - desired session parameter value
Configure Defaults for All Sessions
In order to configure the default parameter value for all sessions, use Default as SessionName. See example below for details.
Session.Default.UseBlockingSockets = true Session.Default.DisableTCPBuffer = true Session.Default.StorageType = persistentMM Session.Default.Validation.IsEnabled = false
Configure Specific Session
In order to configure parameters for some specific session, use its SenderCompID/TargetCompID pair as SessionName. See example below for details.
Session.CLIENT1/EXECUTOR.UseBlockingSockets = true Session.CLIENT1/EXECUTOR.DisableTCPBuffer = true Session.CLIENT1/EXECUTOR.StorageType = persistentMM Session.CLIENT1/EXECUTOR.Validation.IsEnabled = false
Prioritizing Rules
The engine uses properties for creating a session in the following order (If the property is not defined in the current step, then the value from the next step is used):
- Properties configured in the C++ code as Engine::SessionExtraParameters value before the session creation
- Session specific settings defined as properties with Session.SenderCompID/TargetCompID pair in the engine.properties
- Default sessions settings defined as Session.Default properties in the engine.properties
- Hardcoded FIX Antenna Engine defaults
List of Available Parameters
Session Parameters
Property | Description | Valid values | Defaults |
---|---|---|---|
SenderSubID | SenderSubID (tag 50) - assigned value used to identify specific message originator (desk, trader, etc.). Ignored if the NULL value specified. | ||
TargetSubID | TargetSubID (tag 57) - assigned value used to identify a specific individual or unit intended to receive the message. 'ADMIN' reserved for administrative messages not intended for a specific user. Ignored if NULLvalue is specified. | ||
SenderLocationID | SenderLocationID (tag 142) - assigned value used to identify specific message originator's location (i.e. geographic location and/or desk, trader). Ignored if NULL value is specified. | ||
TargetLocationID | TargetLocationID (tag 143) - assigned value used to identify specific message destination's location (i.e. geographic location and/or desk, trader). Ignored if NULL value specified. | ||
Username | User name
| ||
Password | User's password
| ||
UsernameTag | Specifies a tag used to store a username | ||
PasswordTag | Specifies a tag used to store a password | ||
CustomSessionType | Specifies whether a session should encrypt the password each time | GENERIC - generic session LME_SELECT- encrypt password tag each time TOTAL_SSN_TYPES - Represents a number of sessions types CME_SECURE_LOGON - use CME secure logon scheme | GENERIC |
CMESecureKeysFileThe parameter is available since FIX Antenna C++ 2.23.0 | Specifies a path to CME keys files used for CME secure logon | ||
FixKey | Specifies a FIX key for LME sessions | ||
ForcedReconnect | Forced Reconnect mode - the session will try to reconnect when:
| false | |
EnableMessageRejecting | When true, the session rejects application messages when the session is unable to send them during a specified period or was disconnected. | false | |
IgnoreSeqNumTooLowAtLogon | When true, the session ignores 'SeqNum too low' at an incoming Logon message and continues with the received SeqNum. | false | |
IntradayLogoutToleranceMode | Intraday logout tolerance mode. An option to reset or not to reset sequence numbers after Logout. | false | |
HandleSeqNumAtLogon | Handles sequence gaps using NextExpectedMsgSeqNum field in the Logon. | false | |
ForceSeqNumReset | Force SeqNum reset mode. | FSNR_NA - take the value from the properties file. FSNR_ON - Use tag 141 at first Logon to reset the sequence number. FSNR_ALWAYS - Reset sequence number at every Logon. FSNR_OFF - Do not use tag 141 at Logon to reset the sequence number. | FSNR_NA |
EncryptMethod | Encryption method | NONE | NONE |
SuppressDoubleResendRequest | Suppresses a session to send the Resend request message on every incoming message with a sequence greater than expected. | false | |
AllowMessageWithoutPossDupFlag | This parameter is an option whereby the repeated messages are received without a PossDupFlag (43) field. It's used for incoming messages only. If set to "true" and a message is received with a sequence number less than expected without PossDupFlag (43), the message will be processed. This parameter is optional. | false | |
SendLastMsgSeqNumProcessed | Allows the LastMsgSeqNumProcessed(369) tag to be automatically added to outgoing messages. | false | |
ResendRequestBlockSize | Defines the number of messages requested using Resend Request messages. If the message sequence gap is larger than SessionExtraParameters::resendRequestBlockSize_, Session will split resend requests by blocks of SessionExtraParameters::resendRequestBlockSize_ size. | -1 | |
CpuAffinity | Specifies affinity mask for dedicated threads of the session. It makes sense only for aggressive modes. | Mask should be presented in the decimal system. | 0 |
RecvCpuAffinity | Specifies affinity mask for dedicated receiving thread of session. It makes sense only for an aggressive receive mode. | Mask should be presented in the decimal system. | 0 |
SendCpuAffinity | Specifies affinity mask for dedicated sending thread of session. It makes sense only for an aggressive send mode. | Mask should be presented in the decimal system. | 0 |
LogonMessageSessionQualifierTag | Defines the tag of the field to be used by FIX Engine when dispatching an incoming connection. | ||
SendingTimestampUnitThe parameter is available since FIX Antenna C++ 2.20.0. | Defines the precision of the timestamp to be specified in 52 tag (SendingTime) and 122 tag (OrigSendingTime) in outgoing message. |
|
|
OutOfSequenceMessagesStrategyThe parameter is available since FIX Antenna 2.23.0 | This parameter sets a strategy for processing out-of-sequence messages for a specific session. | RequestAlways RequestOnce IgnoreGap Queue | RequestAlways |
OutOfSequenceMessagesStrategy.QueueSizeThe parameter is available since FIX Antenna 2.23.0 | The size of the temporary queue for processing out-of-sequence messages (measured in a count of messages). The parameter is used if the parameter OutOfSequenceMessagesStrategy=Queue. | 2000 | |
ParserVersionThe parameter is available since FIX Antenna 2.25.1 | Name of unique parser for FIX protocol | FIX40 <Custom_Name>@<Protocol_version> | |
RoleThe parameter is available since FIX Antenna 2.25.1 | Role of the session | Initiator Acceptor | |
HostThe parameter is available since FIX Antenna 2.25.1 | The host for an initiator session | ||
PortThe parameter is available since FIX Antenna 2.25.1 | TCP port for connection to a remote site | ||
HBIThe parameter is available since FIX Antenna 2.25.1 | The heartbeat interval in seconds for an initiator session | ||
CustomLogonMessageFileNameThe parameter is available since FIX Antenna 2.25.1 | Path to file with a Custom logon message for the initiator | ||
TagsDelimiterThe parameter is available since FIX Antenna 2.28.0 | The character used as a tags delimiter in a FIX message | <SOH> |
Validation Parameters
Property | Description | Valid values | Defaults |
---|---|---|---|
ValidateCheckSum | If true, the session will skip CRC validation for incoming messages. | true | |
GenerateCheckSum | If false, the session will not calculate CRC for outgoing messages. | true | |
Validation.IsEnabled | Option to enable message validation. Pass true to enable; false to disable. | false | |
Validation.ProhibitTagsWithoutValue | When false, a raw message may contain tags without values - they will be ignored. Otherwise, std::exception is fired. | ||
Validation.VerifyTagsValues | This parameter controls tag values validation. The possible values are "true" and "false". If set to "true", then all messages will be validated. If set to "false" then the responsibility for message validity rests with the counterparty. | false | |
Validation.ProhibitUnknownTags | This parameter controls unknown tag handling. The possible values are "true" and "false". If set to "true", then all unknown fields will be stored to the message. If set to "false", engine will reject messages with unknown fields. | false | |
Validation.VerifyReperatingGroupBounds | This parameter controls repeating group size checking. If true, engine will reject messages with incorrect repeating group size. Otherwise, message will be passed to the application layer. In this case the responsibility for message validity rests with the counterparty. | false | |
Validation.CheckRequiredGroupFields | This parameter controls the validation of required fields in repeating group. The possible values are "true" and "false". If set to "true", then repeating groups will be checked for the presence of required fields. If set to "false" then the responsibility for repeating group validity rests with the counterparty. The recommended setting is "true". This parameter is optional. | true | |
Validation.ProhibitDuplicatedTags | When false, raw message may contain duplicated field definitions. Otherwise, reject will be fired. Works only as Session.Default.Validation.ProhibitDuplicatedTags or Session.CLIENT1/EXECUTOR.Validation.ProhibitDuplicatedTags | true | |
Validation.IgnoreUnknownFields | Ignores undefined fields during message parsing. | false |
Storage and FIX Logging Parameters
Property | Description | Valid values | Defaults |
---|---|---|---|
HiddenLogonCredentials | Masks password in in/out log files | false | |
MessagesStorageSize | This parameter specifies in-memory messages storage size. | 20000 | |
LogIncomingMessages | If true, the session will store incoming FIX messages. | true | |
StorageType | Message storage type | persistent transient persistentMM splitPersistent null | persistentMM |
Connection Parameters
Property | Description | Valid values | Defaults |
---|---|---|---|
KeepConnectionState | When true, primary to backup (and back) connection switching continue using existing message storage. | true | |
UseAsyncConnect | When true, session initiator will use async TCP connect. | false | |
DisableTCPBuffer | When true, TCP buffer (Nagle algorithm) will be disabled for session. | false | |
SocketRecvBufSize | Socket incoming buffer size. | -1 | |
SocketSendBufSize | Socket outgoing buffer size. | -1 | |
MaxMessagesAmountInBunch | Enqueued outgoing messages could merged and sent as a single buffer. | The 0 means infinite amount. | 0 |
EnableAutoSwitchToBackupConnection | When true, automatic switch mode is enabled. | false | |
CyclicSwitchBackupConnection | When true, connection will be switched from primary to backup and back until connection will be established. | false | |
SourceIPaddress | The expected value of the source IP address. | ||
SocketOpPriority | The priority of the socket send/receive operations. | NA EVEN AGGRESSIVE_SEND AGGRESSIVE_RECEIVE AGGRESSIVE_SEND_AND_RECEIVE DIRECT_SEND DIRECT_SEND mode is available since FIX Antenna 2.23.0 | EVEN |
Transport | Low-level transport of the session. | SOCKETS - Kernel sockets | SOCKETS |
AggressiveReceiveDelay | Defines a polling interval in microseconds for reading data from the socket. Works only with aggressive sessions i.e. Engine::AGGRESSIVE_RECEIVE_SOCKET_OP_PRIORITY or Setting lower value reduces the latency but causes high CPU utilization. The default value is 500 microseconds. There will not be a delay after an attempt to receive a message if the socket buffer still is not empty. | 500 | |
ReconnectMaxTries | This parameter specifies the number of attempts to restore the session. The session is considered as restored if the telecommunication link was restored and the exchange of Logon messages was successful. If it is set to "-1", then the number of attempts is unlimited. | 3 | |
ReconnectInterval | This parameter specifies the time interval between reconnection attempts in order to restore a communications link. | 1000 | |
ConnectAddress | Specifies IP of the NIC interface used to connect to the remote site. | ||
ConnectPort | Specifies TCP port used to connect to the remote site. | ||
UseBlockingSockets | If true, the session will use blocking I/O.
| false |
Create pre-configured sessions from a properties file
FIX Antenna 2.25.1. introduces a mechanism that allows passing a session configuration through a file.
The scenario below describes the case when the application gets all configured sessions from the properties file and iterates over the sessions list and creates them.
With this scenario, all initiator sessions connect immediately to the counterparty.
FIX Antenna C++ code example
FIX Antenna .NET code example
Creating initiator and acceptor
######### CLIENT1/SRV1 session ######### Session.CLIENT1/SRV1.ParserVersion = FIX44 Session.CLIENT1/SRV1.Role = Initiator Session.CLIENT1/SRV1.Host = 127.0.0.1 Session.CLIENT1/SRV1.Port = 9090 Session.CLIENT1/SRV1.HBI = 30 #Other required session properties if any ######### ESVR/CTG session ######### Session.ESVR/CTG.ParserVersion = FIX44 Session.ESVR/CTG.Role = Acceptor #Other required session properties if any
Pass Custom Logon Message to initiator from properties file.
######### CLIENT1/SRV1 session ######### Session.CLIENT1/SRV1.ParserVersion = FIX44 Session.CLIENT1/SRV1.Role = Initiator Session.CLIENT1/SRV1.Host = 127.0.0.1 Session.CLIENT1/SRV1.Port = 9090 Session.CLIENT1/SRV1.HBI = 30 Session.CLIENT1/SRV1.CustomLogonMessageFileName = Logon.msg
An example of Logon message (35=A): Logon.msg
Create SSL sessions with properties file
FIX Antenna 2.26.0. has updated SSL support, extending the variety of formats accepted and password protected certificates/keys support.
FIX Antenna support certificates in PEM, PFX and DER formats along with private keys in PEM and DER formats.
Password protected certificates/keys can be used as well. The password is specified within plain text in engine.properties.
The cases below demonstrate how to configure Initiator/acceptor sessions in order to make them SSL enabled.
SSL related properties are demonstrated only assuming that session is generally configured already.
Creating initiator and acceptor:
######### Engine wide properties ######### # Used for all acceptor sessions and as default values for Initiator sessions. if ListenSSLPort is specified and optional otherwise. # Mandatory. Set protocols accepted by the engine. SSLProtocols = TLSv1_2 # Optional. Engine default values used if omitted. SSLCiphersList = AES+aRSA:AES+aECDH:AES+aECDSA:@STRENGTH # mandatory. Certificate file to use. SSLCertificate = mycert.pem # Optional. Applicable if only certificates is password protected. SSLCertificatePassword = mycertPassword # Optionality is correlated with SSLCertificate. # It means if no SSLCertificate specified then this property becomes seamless. It becomes optional if private key is already contained inside SSLCertificate file. # This is possible for PEM and PFX formats but not for DER! SSLPrivateKey = mycertKey.pem # Optional if private key is not password protected. Please pay attention to the fact the this password is used for private key stored within certificate file as well. # So it has meaning even if SSLPrivateKey is empty in this case. SSLPrivateKeyPassword = mycertKeyPassword # Optional if no peer certificate validation is required. This is a path to the file containing CA certificates (all in one file on after another, PEM format only!). # This certificates are used to build accepted certificates list sent to peer as well. SSLCACertificate = CACerts.pem # Optional. false by default. Setting this property to true requires SSL engine to validate counter-party's certificate against CAs provided. # If validation has failed or no certificate was provided by counter-party connection is terminated immediately. # Set this to true in order to accept only connection verified with certificate. SSLValidatePeerCertificate = true ######### CLIENT1/SRV1 Initiator session ######### # Enable SSL support for the session Session.CLIENT1/SRV1.SSL = true # Optional. Overrides engine wide SSLProtocols property for the session Session.CLIENT1/SRV1.SSLProtocols = TLSv1_2 # Optional. Overrides engine wide SSLCiphersList property for the session Session.CLIENT1/SRV1.SSLCiphersList = AES+aRSA:AES+aECDH:AES+aECDSA:@STRENGTH # Optional for initiators. Certificate file to use if certificate based authentication is requested by peer. Session.CLIENT1/SRV1.SSLCertificate = mycert.pem # Optional. Applicable if only certificates is password protected. Session.CLIENT1/SRV1.SSLCertificatePassword = mycertPassword # Optionality is correlated with SSLCertificate. # It means if no SSLCertificate specified then this property becomes seamless. It becomes optional if private key is already contained inside SSLCertificate file. # This is possible for PEM and PFX formats but not for DER! Session.CLIENT1/SRV1.SSLPrivateKey = mycertKey.pem # Optional if private key is not password protected. Please pay attention to the fact the this password is used for private key stored within certificate file as well. # So it has meaning even if SSLPrivateKey is empty in this case. Session.CLIENT1/SRV1.SSLPrivateKeyPassword = mycertKeyPassword # Optional if no peer certificate validation is required. This is a path to the file containing CA certificates (all in one file on after another, PEM format only!). Session.CLIENT1/SRV1.SSLCACertificate = CACerts.pem # Optional. false by default. Setting this property to true requires SSL engine to validate counter-party's certificate against CAs provided. If validation has failed connection is terminated immediately. # Set this to true in order to validate acceptors certificate. Session.CLIENT1/SRV1.ValidatePeerCertificate = true ######### ESVR/CTG Acceptor session ######### # Restricts the session to accept connections from SSL listener only. Session.ESVR/CTG.SSL = true # All remaining properties are engine wide for the acceptors and can't be specified on per-session basis. # So they are configured with engine wide properties.