Skip to content

Latest commit

 

History

History
1388 lines (1330 loc) · 52.5 KB

Configuration.md

File metadata and controls

1388 lines (1330 loc) · 52.5 KB

Configuration

FIX Antenna provides a few ways for configuring its behavior. The global configuration is defined in the default configuration file: fixengine.properties. It’s also possible to define and load custom configuration for sessions from a separate file.

Global configuration

Antenna loads global settings from a configuration file with a fixed name: fixengine.properties. This file should be placed in one of the following places:

  1. in a custom directory configured via Config.ConfigurationDirectory
  2. in the application working directory
  3. in the user home directory
  4. inside the library as an embedded resource

Global settings could include server behavior and/or default behavior of sessions.

Server behavior

The table below specifies the server behavior settings.

Property Name Default Value Description
performResetSeqNumTime false This parameter specifies whether to reset a sequence number at the time defined in resetSequenceTime.
switchOffSendingMultipleResendRequests false This parameter specifies whether to send multiple RR for the same gap or not.
resetSequenceTime 00:00:00 This parameter specifies the GMT time when the FIX Engine initiates the reset.
resetSequenceTimeZone UTC Time zone id for resetSequenceTime property. More information about time zone format: System.TimeZoneInfo.Id
intraDaySeqNumReset false This parameter specifies whether to reset a sequence number after a session is closed.
Valid values: true | false.
Default value: false.
encryptionConfig ${fa.home}/
encryption/
encryption.cfg
This parameter specifies the encryption config file name. Valid values: existent valid config file name (relative or absolute path).
encryptionMode None This parameter specifies the default value of encryptionMode.
Valid values: None | Des | PgpDesMd5.
Default value: None
autoreconnectAttempts -1 Specifies the number of autoreconnect attempts:
  • negative number - no reconnects
  • 0 - infinite number of reconnects
  • positive number - number of reconnect attempts
Please use 0 wisely - it means attempting to reconnect infinitely.
autoreconnectDelayInMs 1000 Specifies a delay between autoreconnect attempts in milliseconds, the default value is 1000ms.
The parameter must be an integer and not negative. Otherwise, the default value for this parameter will be used.
loginWaitTimeout 5000 Sets the timeout interval after which a connected acceptor session will be timed out and disposed if the Logon is not received for this session.
The parameter must be an integer and not negative. Otherwise, the default value for this parameter will be used.
logoutWaitTimeout Sets disconnect timeout in seconds for the logout.
The parameter must be an integer and not negative. Otherwise, the session's HeartbeatInterval will be used.
handleSeqNumAtLogon false This parameter specifies whether to process the 789-NextExpectedMsgSeqNum tag. If true, the outgoing sequence number must be updated by the 789-NextExpectedMsgSeqNum tag value.
disconnectOnLogonHeartbeatMismatch true Checks and disconnects a session if the Logon answer contains a HeartBtInt(108) value other than one defined in the session configuration.
forcedLogoffTimeout 2 Sets the disconnect timeout in seconds for a Logout ack only when waiting.
The Logout ack from the counterparty is caused by the incoming sequence number being less than expected. The parameter must be an integer and not negative. Otherwise, the standard value for this parameter will be used.
sendRejectIfApplicationIsNotAvailable true Sends a reject if a user application is not available. If the value is false and the client applicaiton is not available, acts like a "black hole" - accepts and ignores all valid messages.
rawTags 96, 91, 213, 349, 351, 353, 355, 357,
359, 361, 363, 365, 446, 619, 622
Raw tags.
Lists all tags that the Engine should treat as raw. A raw tag may contain a SOH symbol inside it and should be preceded by the rawTagLength field.
maskedTags 554, 925 Masked tags.
List of tags whose values are masked by the Engine when used in in/out log files.
resendRequestNumberOfMessagesLimit 0 Limits the maximum number of messages during the resend request. If more messages are requested, the reject will be sent in response.
The parameter must be an integer and not negative. Otherwise, the default value for this parameter will be used.
maxRequestResendInBlock 0 The max requested messages in block. This parameter defines how many messages will be requested in one block. The value must be an integer and not less than 0.
testRequestsNumberUponDisconnection 1 This parameter specifies number of Test Request messages that will be sent before connection loss is reported when no messages are received from the counterparty. Valid values: positive integer.
advancedResendRequestProcessing false This parameter specifies whether to subsequently issue uplicates (PossDupFlag(43) = 'Y') of the last Resend Request for continuing gaps resting on the LastMsgSeqNumProcessed(369) field values of incoming messages. The counterparty must then respond only to the original request or a subsequent duplicate Resend Request if it missed the original. The duplicate(s), otherwise, can be discarded, as it does not have a unique message sequence number of its own. Valid values: true | false
skipDuplicatedResendRequests false This parameter specifies whether to respond only to the original request or a subsequent duplicate Resend Request if it missed the original. If this option is disabled, FA will respond to any Resend Request. Valid values: true | false
serverAcceptorStrategy Epam.FixAntenna.NetCore.FixEngine.Acceptor.
AllowNonRegisteredAcceptor
StrategyHandler
This parameter specifies the default Acceptor Strategy. Valid values: subclasses of
  • Epam.FixAntenna.NetCore.FixEngine.Acceptor.SessionAcceptorStrategyHandler
  • Epam.FixAntenna.NetCore.FixEngine.Acceptor.AllowNonRegisteredAcceptorStrategyHandler
  • Epam.FixAntenna.NetCore.FixEngine.Acceptor.DenyNonRegisteredAcceptorStrategyHandler
possDupSmartDelivery false This parameter enables the delivery of only those PossDup messages that weren't received previously, discarding already processed possDups. Valid values: true | false
maxMessageSize 1Mb Maximum message size supported by this FIX engine instance.
The parameter must be an integer and not negative. Otherwise, the default value for this parameter will be used. Should be set to a greater than expected maximum message by approximately 1-5%.
  • positive number - maximum allowed size of incoming message
  • 0 - any size message allowed (not recommended, could lead to OutOfMemoryError if the counterparty sends an invalid stream)
includeLastProcessed false Include the last processed sequence 369 tag in every message for FIX versions > 4.2.
enableMessageRejecting false Enable/disable message rejecting. If this feature is enabled, and during session closing there are messages in its output queue, they will be passed to the session's `IRejectMessageListener` and the queue will be cleaned. If this feature is disabled, messages will be left in the queue and processed according to queue behavior.
enableMessageStatistic true Enable/disable message statistics, such as the number of messages and bytes that were read and sent.
enableNagle true Disable/enable Nagle's algorithm for TCP sockets. This option has the opposite meaning of the TcpNoDelay socket option. When enabled, Nagle's algorithm will be better throughput (TcpNoDelay=false). When disabled, you will get a better result for latency on a single message (TcpNoDelay=true)
Default value is true.
recvCpuAffinity -1 This parameter specifies a cpu id for the threads of a session that receives data from socket.
sendCpuAffinity -1 This parameter specifies a cpu id for the threads of a session that sends data in socket.
cpuAffinity -1 This parameter specifies a cpu id for the threads of a session that sends and receives data from/in socket.
connectAddress The engine's local IP address to send from. It can be used on a multi-homed host for a FIX Engine that will only send IP datagrams from one of its addresses.
If this parameter is commented, the engine will send IP datagrams from any/all local addresses.
resetOnSwitchToBackup false Reset sequences on switch to backup.
resetOnSwitchToPrimary false Reset sequences on switch back to primary connection.
enableAutoSwitchToBackupConnection true Enable auto switching to backup connection, the default value is true.
cyclicSwitchBackupConnection true Enable switching to primary connection, the default value is true.
forceSeqNumReset Never This parameter allows automatically resolving the sequence gap problem (for example, when there is a sequence reset every day). Supported values: Always, OneTime, Never.
If this parameter is set to:
  • Always - the session will send logon with 34= 1 and 141=Y every time (during connection and reconnection).
  • OneTime - the session will send logon with 34= 1 and 141=Y only one time (during connection). It works within the session object lifetime.
    session.Connect(); // Reset
    ...
    session.Disconnect("Disconnect message");
    ...
    session.Connect(); // Reconnection. No reset
    
  • Never - the user can set 34= 1 and 141=Y from the session parameters by hand.
ignorePossDupForGapFill true Enable this option if you need to handle a SequenceReset-GapFill message without PossDupFlag(43). This option also allows ignoring the absence of OrigSendingTime(122) in that kind of message.
Valid values: true | false
checkSendingTimeAccuracy true Toggle the check of SendingTime(52) accuracy for received messages on/off.
reasonableDelayInMs 120000 Sending time delay for incoming messages.
The parameter must be an integer and not negative. Otherwise, the default value for this parameter will be used.
heartbeatReasonableTransmissionTime 200 This parameter specifies "some reasonable transmission time" of the FIX specification, measured in milliseconds.
Valid values: positive integer
measurementAccuracyInMs 1 Measurement accuracy for sending time.
The parameter must be an integer and not negative. Otherwise, the standard value for the parameter will be used.
timestampsPrecisionInTags Milli The desired precision of timestamps in appropriate tags of the FIX message.
Valid values: Second | Milli | Micro | Nano.
allowedSecondsFractionsForFIX40 false If enabled, use the timestamp with precision defined by the timestampsPrecisionInTags option for FIX 4.0.
preferredSendingMode sync This parameter specifies the way the session will send most of its messages:
  • Async - the session will send all messages asynchronously, in separate threads. The client thread will be released as fast as possible.
  • Sync - the session will be optimized to send messages from the user thread synchronously, but it still can make asynchronous operations and allows sending messages to the internal queue. Synchronous sending is faster, but tge user thread can be affected by delays on network writing.
  • SyncNoqueue - the session sends messages only from the user thread and doesn't use the internal queue. It's impossible to send messages to a disconnected session.
waitForMsgQueuingDelay 1000 This parameter specifies the maximum delay interval on message sending if the internal session queue is full.
If the internal session's queue is full, FIX Antenna pauses sending the thread until the message pumper thread sends some messages and frees some space in the queue. If after the delay, the interval queue is still full, the message will be pushed to the queue anyway.
Valid values: positive integer
ignoreSeqNumTooLowAtLogon false This parameter allows resolving a wrong incoming sequence at Logon. When set to true the session continues with the received seqNum.
resetQueueOnLowSequence true When disabled, prevents outgoing queue reset if the client is connecting with a lower than expected sequence number. Once a session is reestablished, queued messages will be sent out.
Please note that queued messages won't be sent out until the session is fully established regardless of this parameter.
quietLogonMode false Enable this option if you need to quietly handle Logout as the first session message. FIX Specification requires that first message is a Logon message. Otherwise, the Logout message must contain the warning "First message is not logon". Additionally, sоmetimes the first incoming Logout message has the wrong sequence (for example, if you send a Logon with 141=Y). This option allows skiping sending a ResendRequest and warning to the counterparty.
allowedCountOfSimilarRR 3 This option indicates how many similar ResendRequests (for the same range of sequences) the engine may send before detecting a possible infinite resend loop. This should prevent an infinite loop from requesting the same corrupted messages many times or if the user logic can't correctly handle a message and throws an exception every time.
The parameter must be an integer and not negative. Otherwise, the standard value for this parameter will be used.
throttleCheckingEnabled false Enables throttling checks per message type.
If this option is enabled, the engine counts how many times a session receives messages with a given message type during 'throttleCheckingPeriod'. If this counter is greater than the value in throttleChecking.MSG_TYPE.threshold, the session will be disconnected with the reason: THROTTLING.
throttleCheckingPeriod 1000 Defines a period common for all throttling per message type checks.
Default value: 1000 milliseconds
throttleChecking.MsgType.threshold -1 Allowed number of messages with MsgType type for a given 'throttleCheckingPeriod' period.
Valid values: positive integer
Default value: -1 (disabled)
resetThreshold 0 This parameter specifies a gap in sequences during connecting that may be treated as missed sequence reset event by the counterparty. It works if the current session has reset sequences and expects a message (Logon) with 34=1 but the counterparty is still sending messages with much higher sequences (because they didn't do a reset on their side).
This option helps control bidirectional agreed sequence reset events and prevents requesting old messages.
This option only works for acceptor sessions.
Default value is 0, which means the check is not going to be performed.
slowConsumerDetectionEnabled false This parameter enables slow consumer detection during message sending.
Default value: false (disabled)
slowConsumerWriteDelayThreshold 10 This parameter is used for decision making in slow consumer detection in pumpers.
It defines a maximum timeframe for sending a message. If the session transport can't send a message during this timeframe, it will notify about a slow consumer.
Default value: 10 (milliseconds)
system.messagehandler.global.X Set of predefined handlers Sets global message handler(s). A handler will be called upon for each and every incoming message.
You can define your own set of global message handlers, but you should be very careful. The default set of handlers provides integrity checks like sending time accuracy, sequencing, visioning, validation.
NOTE: Handlers will be applied in reverse order: a handler with a bigger number will be applied first.
NOTE: Handler numbers should be unique and sequential.
NOTE: Handlers can prevent further message processing.
user.messagehandler.global.X   User supplied handlers.
This set of handlers will be applied after system handlers for every incoming message (if it does not fall out).
NOTE: Handlers will be applied in reverse order: a handler with a bigger number will be applied first.
NOTE: Handler numbers should be unique and sequential.
NOTE: Handlers can prevent further message processing. Example: You can enable the DeliverToCompId message handler for 3rd Party Message routing if needed:
user.messagehandler.global.0=Epam.FixAntenna.NetCore.FixEngine.Session.MessageHandler.User.DeliverToCompIdMessageHandler
system.messagehandler.MsgType Set of predefined handlers Sets the handler per message type that will be called upon for each and every incoming message.
This set of properties is for redefining engine behavior. You can change the default processing for the following session message types: Logon(A), Heartbeat(0), Test Request(1), Resend Request(2), Reject(3), Sequence Reset(4), Logout(5).
NOTE: Handler numbers should be unique and sequential. These handlers will be applied after system and user defined global message handlers.
NOTE: Handlers can prevent further message processing.
Example:

system.messagehandler.3=MyCompany.Custom.RejectMessageHandler
autostart.acceptor.targetIds   Comma separated list of TargetCompID for automatic accepting sessions on the server.
For each of the sessions below, other parameters such as login, password, source IP filter and listener should be set.
IP filter could be defined as "*", which means that connection from any address is allowed. Or this property can contain a comma separated list of allowed IPs of subnet masks like 192.168.0.1/16.
For example, you can enable the administrative plugin in the following way:

autostart.acceptor.targetIds=admin
autostart.acceptor.admin.login=admin
autostart.acceptor.admin.password=admin
autostart.acceptor.admin.ip=*
autostart.acceptor.admin.fixServerListener=Epam.FixAntenna.AdminTool.AdminTool,Epam.FixAntenna.AdminTool
autostart.acceptor.TARGET_ID.login   Username(553) for automatic session acceptance.
autostart.acceptor.TARGET_ID.password   Password(554) for automatic session acceptance.
autostart.acceptor.TARGET_ID.ip   Source IP for automatic session acceptance or "*" if any applicable.
autostart.acceptor.TARGET_ID.fixServerListener   Implementation of `IFixServerListener` for accepting the given session.
tcpSendBufferSize 0 This parameter specifies value for System.Net.Sockets.Socket.SendBufferSize option
The default value is 0 and it means that the parameter is not specified and the option System.Net.Sockets.Socket.SendBufferSize will not be changed.
tcpReceiveBufferSize 0 This parameter specifies the value for System.Net.Sockets.Socket.ReceiveBufferSize option
The default value is 0 and it means that the parameter is not specified and the option System.Net.Sockets.Socket.ReceiveBufferSize will not be changed.
tradePeriodBegin Cron expression to set the start of the period when the server is allowed to accept a connection.
We use Quartz.NET and their implementation of cron expressions for scheduling. See cron expression for more information about the allowed expression format.
It is possible to combine several cron expressions with the "|" symbol.
Example: 0 0 8 1/2 * ?|0 0 9 2/2 * ?
tradePeriodEnd Cron expression to set the end of the period when the server is allowed to accept a connection.
It is possible to combine several cron expressions with the "|" symbol.
tradePeriodTimeZone UTC Specifies the time zone and affects the tradePeriodBegin and tradePeriodEnd. More information about time zone format: System.TimeZoneInfo.Id
resetSeqNumFromFirstLogon Never Determines if sequence numbers should be accepted from the incoming Logon message. The option allows to reduce miscommunication between sides and easier connect after scheduled sequence reset.
The option doesn’t change behavior if the Logon message contains ResetSeqNumFlag(141) equals to “Y” (in this case session sequence numbers will be reset).
The value ‘Schedule’ allows to adopt to the sequence numbers from the incoming Logon message if the reset time is outdated (the session recovers after scheduled reset time). In this case session’s incoming sequence number will be set to the value of MsgSeqNum(34) tag from the incoming Logon and outgoing sequence number become equivalent to NextExpectedMsgSeqNum (789) tag value (if the tag is present) or will be reset to 1.
Valid values: Never | Schedule

Queue and storage

The table below specifies the queue and storage settings.

Property Name Default Value Description
storageFactory Epam.FixAntenna.NetCore.FixEngine.Storage.
FilesystemStorageFactory
Allows a user to replace the storage factory with the user's own implementation.
FIX Antenna provides 4 implementations:
  • FilesystemStorageFactory - factory with persistent storage, all messages will be saved on disk
  • SlicedFileStorageFactory - factory with persistent storage and possibility to set max file size (use the maxStorageSliceSize property)
  • MmfStorageFactory - factory with persistent file storage (using the memory mapped files technology)
  • InMemoryStorageFactory - provides fast in-memory storage, but during session restart all messages will be lost
queueThresholdSize 0 Maximum number of messages in a queue before the pumper thread is paused to let the queued message be sent out.
  • Set rather high for max performance.
  • Set 1 or pretty low for realtime experience.
  • 0 - disable queue control, do not pause the pumper thread.
The parameter must be an integer and not negative. Otherwise, the default value for this parameter will be used.
maxMessagesToSendInBatch 10 The maximum number of messages in the buffer before a message is written to transport.
NOTE: Value for this property should be always > 0.
inMemoryQueue false Sets queue mode.
This property makes sense only if FilesystemStorageFactory or MmfStorageFactory is set.
Set to "false" for a persistent queue (slower but no messages will be lost), "true" for in-memory queue (faster but less safe, some messages may be lost).
memoryMappedQueue true Sets persistent queue mode for MmfStorageFactory.
This property makes sense only if MmfStorageFactory is set.
Set to "false" for persistent queue (slower but no messages will be lost), "true" for memory mapped queue (faster but less safe, some messages may be lost)
incomingStorageIndexed false Incoming storage index.
This property makes sense only if the file storage is set.
Enabled index - messages in incoming storage will be available via API.
outgoingStorageIndexed true Outgoing storage index.
This property makes sense only if the file storage is set.
Set to "true" to enable outgoing storage index that is to be used in decision making in the resend request handler. Enabled index - support resend request, disabled - never resend messages and always send gap fill.
maxStorageSliceSize 100Mb Specifies the maximum size of the storage file after which the engine creates a new storage file with a different name.
Parameter must be integer and not negative.
This property makes sense only if SlicedFileStorageFactory is set.
Default value: 100Mb.
storageGrowSize false Enable/disable storage grow.
Default value: false.
This parameter and maxStorageGrowSize only work with a persistent session.
maxStorageGrowSize 1Mb Sets the maximum storage grow size in bytes.
Parameter must be an integer and not negative.
Default value: 1Mb.
mmfStorageGrowSize 100Mb Sets the storage grow size in bytes for memory mapped implementation.
Parameter must be an integer and not negative.
This property makes sense only if MMFStorageFactory is set.
Default value: 100Mb.
mmfIndexGrowSize 20Mb Sets the index grow size in bytes for memory mapped implementation.
Only used for storage with a memory mapped index file.
Parameter must be an integer and not negative.
This property makes sense only if MmfStorageFactory is set and at least one of incomingStorageIndexed or outgoingStorageIndexed is true.
Default value: 20Mb.
timestampsInLogs true Ability to write timestamps in the in/out log files.
Default value: true.
timestampsPrecisionInLogs Milli The desired pecision of timestamps in the in/out log files.
Valid values: Milli | Micro | Nano.
backupTimestampsPrecision Milli The desired pecision of timestamps in names of storage backup files.
Valid values: Milli | Micro | Nano.
logFilesTimeZone System time zone Specifies the time zone and affects the time stamp prefix in the FIX in/out logs. More information about time zone format: System.TimeZoneInfo.Id For sample: logFilesTimeZone=UTC
storageDirectory logs Storage directory could be either an absolute path (like /tmp/logs or c:\fixengine\logs) or a relative path, e.g., logs (this one is relative to the application start directory).
This property makes sense only if file storage is set.
storageCleanupMode None This parameter specifies the cleaning mode for message storage of closed sessions.
Valid values: None | Backup | Delete.
Default value: None.
incomingLogFile {0}.in Incoming log filename template.
{0} will be replaced with the actual sessionID, {1} with the actual SenderCompID, {2} with the actual TargetCompID and {4} with the actual session qualifier.
This property makes sense only if file storage is set.
outgoingLogFile {0}.out Outgoing log filename template.
{0} will be replaced with the actual sessionID, {1} with the actual SenderCompID, {2} with the actual TargetCompID and {4} with the actual session qualifier.
This property makes sense only if file storage is set.
sessionInfoFile {0}.properties Info filename template.
{0} will be replaced with the actual sessionID, {1} with the actual SenderCompID, {2} with the actual TargetCompID and {4} with the actual session qualifier.
This property makes sense only if file storage is set.
outgoingQueueFile {0}.outq Out queue file template.
{0} will be replaced with the actual sessionID, {1} with the actual SenderCompID, {2} with the actual TargetCompID and {4} with the actual session qualifier.
This property makes sense only if file storage is set.
backupIncomingLogFile {0}-{3}.in Backup incoming log filename template.
{0} will be replaced with the actual sessionID, {1} with actual the SenderCompID, {2} with the actual TargetCompID, {3} with the timestamp and {4} with the actual session qualifier.
This property makes sense only if backup storage is set.
backupOutgoingLogFile {0}-{3}.out Incoming log filename template.
{0} will be replaced with the actual sessionID, {1} with the actual SenderCompID, {2} with the actual TargetCompID, {3} with the timestamp and {4} with the actual session qualifier.
This property makes sense only if backup storage is set.

Validation

The table below specifies the validation settings.

Property Name Default Value Description
origSendingTimeChecking true This parameter specifies whether to check the OrigSendingTime(122) field value for incoming possible duplicated messages (PossDupFlag(43) = 'Y')
validateCheckSum true Toggle the validation of the CheckSum(10) field value for incoming messages on/off.
Is relevant only if validateGarbledMessage=true
markIncomingMessageTime false If this option is set to true, transport will set the additional time mark in nanoseconds for incoming messages right after read data from socket.
AbstractFixTransport.GetLastReadMessageTimeNano() method could return this value.
validateGarbledMessage true Toggle the validation of garbled messages for incoming flow on/off
Validates the existence and order of the following fields: BeginString(8), BodyLength(9), MsgType(35), CheckSum(10). Also validates value of BodyLength(9).
validation false Toggle the validation of incoming messages according to the base of custom dictionaries on/off.
The following parameters work only if this property set to "true".
wellformenessValidation true Toggle the validation of fields with the tag values 8, 9, 35 and 10 on/off.
If "validation=false" then this parameter always reads as false.
allowedFieldsValidation true Toggle the validation of allowed message fields on/off.
If "validation=false" then this parameter always reads as false.
requiredFieldsValidation true Toggle the validation of required message fields on/off.
If "validation=false" then this parameter always reads as false.
fieldOrderValidation true Toggle the validation of the order of fields in messages on/off. With this option, the engine will check that tags from the header, body, and trailer were not mixed up.
If "validation=false", this parameter always reads as false.
duplicateFieldsValidation true Toggle the validation of duplicated message fields on/off.
If "validation=false", this parameter always reads as false.
fieldTypeValidation true Toggle the validation of field values according to defined data types on/off.
If "validation=false", this parameter always reads as false.
groupValidation true Toggle the validation of repeating group fields on/off.
If "validation=false", this parameter always reads as false.
conditionalValidation true Conditional validation is very time consuming, so use it carefully.
If "validation=false", this parameter always reads as false.
senderTargetIdConsistencyCheck true This parameter specifies the validation of values in tags 49(SenderCompID), 56(TargetCompID) according to the same session parameters.
If this property equals "false", this validation is disabled.

Administrative plugin

The table below specifies the only setting of the Administrative plugin.

Property  Name Default Value Description
autostart.acceptor.command.package   Name of the custom package for admin command processing.
This property is used for extending the count of admin-commands. By default, the package is null, but if custom commands are present, this property should be initialized.
Example:
autostart.acceptor.command.package=Admin.Commands

Session configuration

In addition to the global settings, you can also define the behavior for a specific session or group of sessions. The description of session’s configuration can be placed into fixengine.properties near global parameters or in a separate file. Antenna supports two formats of session configuration – properties and XML.

Custom session configuration can override global settings for the session and also define additional parameters for session:

Property Name Default Value Description
sessionType Session type. In type not defined that session could be resolved in the same time as initiator and acceptor
Valid values: acceptor | initiator
host The connecting host for an initiator session.
port The connecting port for an initiator session.
senderCompID The SenderCompID for a FIX session.
senderSubID The SenderSubID for a FIX session.
senderLocationID The SenderLocationID for a FIX session.
targetCompID The TargetCompID for a FIX session.
targetSubID The TargetSubID for a FIX session.
targetLocationID The TargetLocationID for a FIX session.
fixVersion Identifies the beginning of a message and its protocol version(Tag = 8).
Valid values: FIX.4.0, FIX.4.1, FIX.4.2, FIX.4.3, FIX.4.4, FIXT.1.1
appVersion Application protocol version(Tag = 1128).
Valid values: FIX.4.0, FIX.4.1, FIX.4.2, FIX.4.3, FIX.4.4, FIX.5.0, FIX.5.0SP1, FIX.5.0SP2
backupHost The backup host for an initiator session.
backupPort The backup port for an initiator session.
incomingSequenceNumber 0 Incoming sequence number.
outgoingSequenceNumber 0 Outgoing sequence number.
processedIncomingSequenceNumber 0 Last valid incoming sequence number.
heartbeatInterval 30 Heartbeat interval.
LastSeqNumResetTimestamp
SeqNumLength 1 This parameter specifies the minimum length for the SeqNum fields.
Valid values: intergers from 1 to 10.
FixMessage User defined fields for messages. If this list is not empty, the engine adds it to each outgoing message.
outgoingLoginFixMessage Additional fields for an outgoing Logon message.
tradePeriodBegin For initiator sessions, it is a cron expression to set a scheduled session start. For acceptor sessions, the parameter overrides the appropriate server value for this session.
We use Quartz.NET and their implementation of cron expressions for scheduling. See cron expression for more information about the allowed expression format.
It is possible to combine several cron expressions with the "|" symbol.
Example: 0 0 8 1/2 * ?|0 0 9 2/2 * ?
tradePeriodEnd For initiator sessions, it is a cron expression to set a scheduled session end. For acceptor sessions, the parameter overrides the appropriate server value for this session.
It is possible to combine several cron expressions with the "|" symbol.
tradePeriodTimeZone UTC Specifies the time zone and affects the tradePeriodBegin and tradePeriodEnd. More information about time zone format: System.TimeZoneInfo.Id

Configure SeqNum fields length

The user can set the length of the Sequence Number fields by using the SeqNumLength parameter.

This parameter is applied to the fields that are processed in the FA .NET library.

The field length can vary from 1 to 10 symbols. All fields of the SeqNum type are padded with leading zeros. The default value is “1”, which implies that no padding is applied.

If the SeqNumLength parameter is missing or a wrong value is specified, the default value is used.

The length of the following SeqNum fields can be configured:

  • StartSeqNo (7)
  • EndSeqNo (16)
  • MsgSeqNum (34)
  • NewSeqNo (36)
  • RefSeqNum (45)
  • LastMsgSeqNumProcessed (369)
  • HopRefID (630)
  • NextExpectedMsgSeqNum (789)

Example:

seqNumLength=5

This setting produces the following formatting of the SeqNum field (tag 34):

8=FIX.4.4 | 9=73 | 35=0 | 34=00002 | 49=ConnectToGateway | 56=EchoServer | 52=20210401-16:10:00.687 | 10=227 |

The FA .NET library regulates the length of these fields on its own, except for HopRefID.

The length of the HopRefID (630) is not regulated by the library. The length of the HopRefID (630) is up to user.

Definition of a session’s configuration via the properties file

The description of a session’s configuration consists of a few sections:

  1. The list of active sessions should be defined in the sessionIDs property. IDs should be separated with semicolon:

    sessionIDs=sessionID1,sessionID2
  2. Default settings for all sessions in this file could be defined with the prefix «sessions.default.»:

    sessions.default.senderCompID=SCID
    sessions.default.storageFactory=Epam.FixAntenna.NetCore.FixEngine.Storage.InMemoryStorageFactory
  3. To define a custom setting for a specified session, use properties with the sessions. <SessionID>. prefix format, where <SessionID> is an ID of this session:

    sessions.NYSE.targetCompID=NYSE
    sessions.NYSE.validation=true

Definition of a session’s configuration via an XML file

The description of a session’s configuration consists of a few sections:

  1. Active sessions should be defined inside the config/sessionIDs tag. IDs should be separated with semicolon:

    <config>
        <sessionIDs>sessionID1,sessionID2</sessionIDs>
        …
    </config>
  2. Default settings for all sessions in this file could be defined inside the config/sessions/default tag:

    <config>
        …
        <sessions>
            <default>
                <senderCompID>SCID</senderCompID>
                <storageFactory>Epam.FixAntenna.NetCore.FixEngine.Storage.InMemoryStorageFactory</storageFactory>
            </default>
        </sessions>
        …
    </config>
  3. The custom configuration for a specified session could be placed inside the tag config/sessions/ <SessionID>, where <SessionID> is an ID of this session:

    <config>
        …
        <sessions>
            <NYSE>
                <targetCompID>NYSE</targetCompID>
                <validation>true</validation>
            </NYSE>
        </sessions>
        …
    </config>

Loading session configuration

Please use the methods of the SessionParametersBuilder class to load a session’s configuration:

//extract configuration for session from config
SessionParameters details = SessionParametersBuilder.BuildSessionParameters("initiators.xml",
"sessionID1");

// create session we intend to work with
IFixSession session = details.CreateNewFixSession();

You can skip a parameter with the path to the configuration file if the session’s configuration is defined in the default configuration file (fixengine.properties)

//extract configuration for session from default config
SessionParameters details = SessionParametersBuilder.BuildSessionParameters("sessionID1");
IFixSession session = details.CreateNewFixSession();

Use the FixServer.ConfigPath property to register configured sessions in servers:

FixServer server = new FixServer();
server.ConfigPath = "acceptor.properties";

FIXServer will register a session automatically if it is defined in the default Antenna configuration file (fixengine.properties).

NOTE: Please make sure that the SenderCompID and TargetCompId parameters are defined for all acceptor sessions. The server uses these parameters for resolving configuration for incoming sessions.

Setting client and server address depending on IP version

When OS supports IPv6 and the server address is not set using the 'FixServer.SetNic(string nic)' method, a socket will be created in the "Dual" mode, allowing both IPv4 and IPv6 connection.

Otherwise, the type of allowed connection depends on the type of address, provided by the 'nic' parameter. For example, if 'nic' is '::1', then IPv6 will be used to create a network socket. And IPv4 - if 'nic' like '127.0.0.1'.

Environment variables for configuration

FIX Anenna configuration properties can be set in environment variables To be applied, an environment variable must comply with the following rules:

  • Variable name must start with the prefix FANET_
  • For hierarchical properties, double underscore '__' should be used instead of the '.' symbol as a delimiter

Example:

Property set in fixengine.properties file:

sessions.session.SenderCompID=senderComp

Property set in environment variable:

FANET_sessions__session__SenderCompID=senderComp

Priority of property sources:

  1. Environment variables
  2. fixengine.properties file
  3. Default value

NOTE: The environment variable name is case insensitive. The environment variable value is case sensitive.

QuickFIX dictionaries support

FIX Antenna .NET Core provides compatibility with QuickFIX dictionaries. QuickFIX dictionaries shoud be used the same way as FIX Antenna dictionaries. To assign a QuickFIX dictionary to all sessions of a specific FIX version, replace the standard FIX Antenna dictionary file with the QuickFIX dictionary file of the same FIX version in the dictionary folder. The name of the file must be the same.

Assign an individual dictionary to a specific session

To assign a dictionary to a specific session:

# comma separated list of custom FIX dictionary aliases
customFixVersions=FIX44Custom,FIX50Custom

# pair of 'fixVersion' and 'fileName' for each FIX dictionary alias with pattern:
# customFixVersion.<custom FIX version alias>.fixVersion=<base standard FIX version>
# customFixVersion.<custom FIX version alias>.fileName=<custom FIX dictionary file name>

# example of custom FIX dictionary based on FIX.4.4
customFixVersion.FIX44Custom.fixVersion=FIX.4.4
customFixVersion.FIX44Custom.fileName=fixdic44-custom.xml

# example of FIX dictionary based on custom application FIX.4.4
customFixVersion.FIX44Custom.fixVersion=FIX.4.4
customFixVersion.FIX44Custom.fileName=fixdic44-custom.xml

# examples of custom FIX dictionary based on FIX.5.0
customFixVersion.FIX50Custom.fixVersion=FIX.5.0
customFixVersion.FIX50Custom.fileName=fixdic50-custom.xml

# assigning FIX dictionaries to sessions
sessions.testSession1.fixVersion=FIX44Custom

sessions.testSession2.fixVersion=FIXT11
sessions.testSession2.appVersion=FIX50Custom