Configuration
FIX Antenna provides a few ways for configuring its behavior. The global configuration is defined in the default configuration file – fixengine.properties. Also it’s possible to define and load custom configuration for sessions from separate file.
Global configuration
Antenna loads global settings from configuration file with fixed name – fixengine.properties. This file should be placed in one of the following places:
- in the application working directory
- in the user home directory
- 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 sequence number at 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 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 sequence number after session is closed. Valid values: true | false. Default value: false. |
encryptionConfig | ${fa.home}/ encryption/encryption.cfg |
This parameter specifies 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:
|
autoreconnectDelayInMs | 1000 | Specifies a delay between autoreconnect attempts in
milliseconds, the default value is 1000ms. The parameter must be 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 Logon is not received for this session. The parameter must be integer and not negative. Otherwise the default value for this parameter will be used. |
logoutWaitTimeout | Sets disconnect timeout in seconds for logout. The parameter must be integer and not negative. Otherwise the session's HeartbeatInterval will be used. |
|
handleSeqNumAtLogon | false | This parameter specifies whether to process 789-NextExpectedMsgSeqNum tag. If true, outgoing sequence number must be updated by 789-NextExpectedMsgSeqNum tag value. |
disconnectOnLogonHeartbeatMismatch | true | Check and disconnect session if Logon answer contains other HeartBtInt(108) value than defined in session configuration. |
forcedLogoffTimeout | 2 | Sets the disconnect timeout in seconds for a Logout ack only when
waiting for. The Logout ack from the counterparty is caused by the incoming sequence number less then expected. The parameter must be 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 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. List all tags that the Engine should treat as raw. Raw tag may contain a SOH symbol inside it and it should be preceided 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 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 request in one block. The value must be integer and not less than 0. |
testRequestsNumberUponDisconnection | 1 | This parameter specifies number of Test Request messages, which 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 issue subsequently duplicates (PossDupFlag(43) = 'Y') of last Resend Request for continuing gaps resting on LastMsgSeqNumProcessed(369) field values of incoming messages. The counterparty then must 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 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 | FixAntenna.FixEngine.Acceptor. AllowNonRegisteredAcceptorStrategyHandler |
This parameter specifies the default Acceptor Strategy. Valid values: subclasses of |
possDupSmartDelivery | false | This parameter enables delivery of only those PossDup messages that wasn'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 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%.
|
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 session's IRejectMessageListener and the queue will be cleaned. In other case messages will be left in the queue and processed according to queue behavior. |
enableMessageStatistic | true | Enable/disable message statistic such as the number of message and bytes was read and sent. |
enableNagle | true | Disable/enable Nagle's algorithm for TCP sockets. This option has the opposite meaning to TcpNoDelay socket
option.
With enabled Nagle's algorithm will be better throughput (TcpNoDelay=false) but with disabled option you will
get better result for latency on single message (TcpNoDelay=true) Default value is true. |
recvCpuAffinity | -1 | This parameter specifies cpu id for a thread of session that receives the data from socket. |
sendCpuAffinity | -1 | This parameter specifies cpu id for a thread of session that sends the data in socket. |
cpuAffinity | -1 | This parameter specifies cpu id for the threads of session that send and receive the data from/in socket. |
connectAddress |
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 allow to automatically resolve sequence gap problem (for example, when there is every day
sequence reset). Supported values: Always, OneTime, Never. If this parameter is set to:
|
ignorePossDupForGapFill | true | Enable this option if it need to handle SequenceReset-GapFill message without PossDupFlag(43).
Also this option allow to ignore absence of OrigSendingTime(122) in such message. Valid values: true | false |
checkSendingTimeAccuracy | true | Toggle on/off the check of SendingTime (52) accuracy for received messages. |
reasonableDelayInMs | 120000 | Sending time delay for incoming messages. The parameter must be integer and not negative. Otherwise, the default value for this parameter will be used. |
heartbeatReasonableTransmissionTime | 200 | This parameter specifies "some reasonable transmission time" of FIX specification, measured in
milliseconds. Valid values: positive integer |
measurementAccuracyInMs | 1 | Measurement accuracy for sending time. The parameter must be 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 | Use timestamp with precision defined by timestampsPrecisionInTags option for FIX 4.0 if enabled. |
preferredSendingMode | sync | This parameter specifies the way the session will send most of its messages:
|
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 then FIX Antenna pause the sending thread till the message pumper thread send some messages and free some space in the queue. If after the delay interval queue still full, then message will be pushed to the queue anyway. Valid values: positive integer |
ignoreSeqNumTooLowAtLogon | false | This parameter allow to resolve wrong incoming sequence at Logon. When it true - session continue with received seqNum. |
resetQueueOnLowSequence | true | When disabled prevents outgoing queue reset if client connecting with lower than expected sequence number.
Once session is reestablished queued messages will be sent out. Please note that queued messages won't be sent out till session if fully established regardless of that parameter. |
quietLogonMode | false | Enable this option if it need to quiet handle Logout as a first session message. FIX Specification requires that first message should be Logon. In other case it needs to send with answer Logout message warning "First message is not logon". Also sоmetimes first incoming Logout has a wrong sequence (for example if you send Logon with 141=Y). This option allow to skip sending ResendRequest and warning to counterparty. |
allowedCountOfSimilarRR | 3 | This option indicate how many similar ResendRequests (for same range of sequences) engine may sends before
detecting possible infinite resend loop. This should prevent infinite loop for requesting many times same
corrupted messages or if user logic can't correctly handle some message and every time throws exception. The parameter must be 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, engine counts how many times session receives messages with some message type during 'throttleCheckingPeriod'. If this counter is greater than the value in throttleChecking.MSG_TYPE.threshold, the session will be disconnected with reason THROTTLING. |
throttleCheckingPeriod | 1000 | Defines period common for all throttling per message type checks. Default value: 1000 milliseconds |
throttleChecking.MsgType.threshold | -1 | Allowed count of message with MsgType type for 'throttleCheckingPeriod' period. Valid values: positive integer Default value: -1 (disabled) |
resetThreshold | 0 | This parameter specifies a gap in sequences during connecting, which may be treated as missed sequence reset
event by the counterpart. It works if current session has reset sequences and expects message (Logon)
with 34=1 but counterparty is still sending messages with much higher sequences (they didn't do reset on
their side). This option helps to control bidirectional agreed sequence reset events and prevents to request old messages. This option is working only for acceptor session. Default value is 0, it means the check is not going to be performed. |
slowConsumerDetectionEnabled | false | This parameter enables slow consumer detection during sending messages. Default value: false (disabled) |
slowConsumerWriteDelayThreshold | 10 | This parameter used for decision making in slow consumer detection in pumpers. It defined a maximum timeframe for sending a message. If 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 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: handler with bigger number will by 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: handler with 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 the 3rd Party Message routing if needed: user.messagehandler.global.0=FixAntenna.FixEngine.Session.MessageHandler.User.DeliverToCompIdMessageHandler |
|
system.messagehandler.MsgType | Set of predefined handlers | Sets the handler of per message type, which will be called upon each and every incoming message. This set of properties is for redefining engine behavior. You can change the default processing for 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 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 contains 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.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 optionThe 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 value for System.Net.Sockets.Socket.ReceiveBufferSize optionThe 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.
|
Queue and storage
The table below specifies the queue and storage settings.
Property Name | Default Value | Description |
storageFactory | FixAntenna.FixEngine.Storage. FilesystemStorageFactory |
Allows a user to replace the storage factory with user's own implementation. FIX Antenna provides 4 implementations:
|
queueThresholdSize | 0 | Maximum number of messages in a
queue before we pause a pumper thread to let the queued message be sent
out.
|
maxMessagesToSendInBatch | 10 | The maximum number of messages in buffer before we write message 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 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 works only with persistent session. |
maxStorageGrowSize | 1Mb | Sets the maximum storage grow size in bytes. Parameter must be integer and not negative. Default value: 1Mb. |
mmfStorageGrowSize | 100Mb | Sets the storage grow size in bytes for memory mapped implementation. Parameter must be 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. Used only for storage with memory mapped index file. Parameter must be 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 on 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 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 actual sessionID, {1} with actual SenderCompID, {2} with actual TargetCompID and {4} with 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 actual sessionID, {1} with actual SenderCompID, {2} with actual TargetCompID and {4} with actual session qualifier. This property makes sense only if file storage is set. |
sessionInfoFile | {0}.properties | Info filename template. {0} will be replaced with actual sessionID, {1} with actual SenderCompID, {2} with actual TargetCompID and {4} with 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 actual sessionID, {1} with actual SenderCompID, {2} with actual TargetCompID and {4} with 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 actual sessionID, {1} with actual SenderCompID, {2} with actual TargetCompID, {3} with timestamp and {4} with 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 actual sessionID, {1} with actual SenderCompID, {2} with actual TargetCompID, {3} with timestamp and {4} with 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 on/off validation of the CheckSum(10) field value for incoming messages Is relevant only if validateGarbledMessage=true |
markIncomingMessageTime | false | Transport will set the additional time mark in nanoseconds for incoming messages right after read data from
socket if this option is set to true.AbstractFixTransport.GetLastReadMessageTimeNano() method could return this value. |
validateGarbledMessage | true | Toggle on/off validation garbled message for incoming flow 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 on/off the validation of incoming messages according to
the base of custom dictionaries. The following parameters work only if this property set to "true". |
wellformenessValidation | true | Toggle on/off validation of fields with tag 8, 9, 35 and 10 values. If "validation=false" then this parameter always reads as false. |
allowedFieldsValidation | true | Toggle on/off validation of allowed message fields. If "validation=false" then this parameter always reads as false. |
requiredFieldsValidation | true | Toggle on/off validation of required message fields. If "validation=false" then this parameter always reads as false. |
fieldOrderValidation | true | Toggle on/off validation of fields order in message. With this option engine will check that tags from the
header, body and trailer were not mixed up. If "validation=false" then this parameter always reads as false. |
duplicateFieldsValidation | true | Toggle on/off validation of duplicated message fields. If "validation=false" then this parameter always reads as false. |
fieldTypeValidation | true | Toggle on/off validation of field values according to defined data types. If "validation=false" then this parameter always reads as false. |
groupValidation | true | Toggle on/off validation of repeating group fields. If "validation=false" then this parameter always reads as false. |
conditionalValidation | true | Conditional validation is very time consuming, so use it carefully. If "validation=false" then this parameter always reads as false. |
senderTargetIdConsistencyCheck | true | This parameter specifies 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’s configuration
In addition to the global settings you can also define the behavior for a specific session or group of sessions. Description of session’s configuration can be placed into fixengine.properties near to global parameters or in a separate file. Antenna supports two formats of session’s configuration – properties and XML.
Custom session configuration could 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 initiator session | |
port | The connecting port for initiator session | |
senderCompID | SenderCompID for fix session | |
senderSubID | SenderSubID for fix session | |
senderLocationID | SenderLocationID for fix session | |
targetCompID | TargetCompID for fix session | |
targetSubID | TargetSubID for fix session | |
targetLocationID | TargetLocationID for fix session | |
fixVersion | Identifies beginning of message and 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 | Backup host for initiator session | |
backupPort | Backup port for 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, Engine add it to each outgoing message. | |
outgoingLoginFixMessage | Additional fields for outgoing Logon message |
Configure SeqNum fields length
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 by 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 session’s configuration via properties file
Description of session’s configuration consists from a few sections:
The list of active sessions should be defined in the sessionIDs property. IDs should be separated with semicolon:
sessionIDs=sessionID1,sessionID2
Default settings for all sessions in this file could be defined with the prefix «sessions.default.»:
sessions.default.senderCompID=SCID sessions.default.storageFactory=com.epam.fixengine.storage.InMemoryStorageFactory
To define custom setting for a specified session, use properties with a prefix with
sessions. <SessionID>.
format, where<SessionID>
is an ID of this session:sessions.NYSE.targetCompID=NYSE sessions.NYSE.validation=true
Definition of session’s configuration via XML file
Description of session’s configuration consists of a few sections:
Active sessions should be defined inside the config/sessionIDs tag. IDs should be separated with semicolon:
<config> <sessionIDs>sessionID1,sessionID2</sessionIDs> … </config>
Default settings for all sessions in this file could be defined inside the config/sessions/default tag:
<config> … <sessions> <default> <senderCompID>SCID</senderCompID> <storageFactory>FixAntenna.FixEngine.Storage.InMemoryStorageFactory</storageFactory> </default> </sessions> … </config>
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 of session’s configuration
Please use methods of the SessionParametersBuilder
class to load 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();
It’s possible to skip parameter with path to the configuration file if session’s configuration is defined in the defaulf configuration file (fixengine.properties)
//extract configuration for session from default config
SessionParameters details = SessionParametersBuilder.BuildSessionParameters("sessionID1");
IFixSession session = details.CreateNewFixSession();
Use the FixServer.SetConfigPath(string configPath)
method to register configured sessions in servers:
FixServer server = new FixServer();
server.SetConfigPath("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. 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, type of the 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'.