Loading Engine Settings From Configuration Files
The EngineSettings values can be loaded from a configuration file using the LoadFromConfigurationFile(string) method.
This method reads the FixEngine
configuration section from the .NET application configuration file (YourApplicationName.dll.config
)
or the XML or JSON file specified by the configFileName
parameter.
For example:
var settings = new EngineSettings();
settings.LoadFromConfigurationFile();
Engine.Init(settings);
Property Names
Property names are described in the EngineSettings.Key class.
Sample Configuration Files
.NET Application Configuration File Sample
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="FixEngine" type="System.Configuration.NameValueSectionHandler"/>
</configSections>
<FixEngine>
<add key="DisableNetworkLevel" value="true"/>
<add key="Dictionary" value="Dictionary1.xml|Dictionary2.xml|Dictionary3.xml"/>
<add key="FileBasedStorage.SegmentSize" value="1000"/>
<add key="FileBasedStorage.IgnoreIntegrityErrors" value="true"/>
<add key="HeartbeatInterval" value="60"/>
<add key="License.Store" value="License"/>
<add key="License.AlertingDaysBeforeExpiration" value="1024"/>
<add key="ListenPort" value="5555,6666,7777"/>
<add key="LocalTimeUsage" value="true"/>
<add key="LocalNetworkInterface" value="255.255.255.155"/>
<add key="Log.Directory" value="Log"/>
<add key="Log.InboundMessages" value="false"/>
<add key="Log.OutboundMessages" value="false"/>
<add key="Log.BeforeSending" value="false"/>
<add key="LogonTimeout" value="10"/>
<add key="LogoutTimeout" value="10"/>
<add key="MessageGrouping" value="10"/>
<add key="ProcessDeliverToCompId" value="false"/>
<add key="Reconnect.Attempts" value="32"/>
<add key="Reconnect.Interval" value="64"/>
<add key="ReasonableTransmissionTime" value="50"/>
<add key="Receive.BufferSize" value="32768"/>
<add key="Receive.SpinningTimeout" value="1000"/>
<add key="Resending.QueueSize" value="2000"/>
<add key="Resending.BatchSize" value="5000"/>
<add key="ResendRequestMaximumRange" value="256"/>
<add key="Send.BufferSize" value="32768"/>
<add key="Send.QueueMaxSize" value="134217728"/>
<add key="Send.LogoutOnException" value="false"/>
<add key="Send.LogoutOnInvalidLogon" value="false"/>
<add key="Send.SpinningTimeout" value="1000"/>
<add key="SetLastMsgSeqNumProcessed" value="true"/>
<add key="SetApplVerId" value="false"/>
<add key="SupportNextExpectedMsgSeqNum" value="true"/>
<add key="TcpNoDelay" value="false"/>
<add key="UpdateSendingTime" value="false"/>
<add key="Validate.EmptyFieldValues" value="true"/>
<add key="Validate.FieldValues" value="true"/>
<add key="Validate.CheckSum" value="true"/>
<add key="Validate.DuplicatedFields" value="true"/>
<add key="Validate.RepeatingGroupEntryCount" value="true"/>
<add key="Validate.RepeatingGroupLeadingField" value="true"/>
<add key="Validate.RequiredFields" value="true"/>
<add key="Validate.UnknownFields" value="true"/>
<add key="Validate.UnknownMessages" value="true"/>
<add key="Versions" value="Fix42|Fix44"/>
<add key="SSL.Protocol" value="Tls11|Tls12"/>
</FixEngine>
</configuration>
XML Configuration File Sample
<?xml version="1.0"?>
<configuration>
<FixEngine>
<DisableNetworkLevel>true</DisableNetworkLevel>
<Dictionary>Dictionary1.xml|Dictionary2.xml|Dictionary3.xml</Dictionary>
<FileBasedStorage.SegmentSize>1000</FileBasedStorage.SegmentSize>
<FileBasedStorage.IgnoreIntegrityErrors>true</FileBasedStorage.IgnoreIntegrityErrors>
<HeartbeatInterval>60</HeartbeatInterval>
<License.Store>License</License.Store>
<License.AlertingDaysBeforeExpiration>1024</License.AlertingDaysBeforeExpiration>
<ListenPort>5555,6666,7777</ListenPort>
<LocalTimeUsage>true</LocalTimeUsage>
<LocalNetworkInterface>255.255.255.155</LocalNetworkInterface>
<Log.Directory>Log</Log.Directory>
<Log.InboundMessages>false</Log.InboundMessages>
<Log.OutboundMessages>false</Log.OutboundMessages>
<Log.BeforeSending>false</Log.BeforeSending>
<LogonTimeout>10</LogonTimeout>
<LogoutTimeout>10</LogoutTimeout>
<MessageGrouping>10</MessageGrouping>
<ProcessDeliverToCompId>false</ProcessDeliverToCompId>
<Reconnect.Attempts>32</Reconnect.Attempts>
<Reconnect.Interval>64</Reconnect.Interval>
<ReasonableTransmissionTime>50</ReasonableTransmissionTime>
<Receive.BufferSize>32768</Receive.BufferSize>
<Receive.SpinningTimeout>1000</Receive.SpinningTimeout>
<Resending.QueueSize>2000</Resending.QueueSize>
<Resending.BatchSize>5000</Resending.BatchSize>
<ResendRequestMaximumRange>256</ResendRequestMaximumRange>
<Send.BufferSize>32768</Send.BufferSize>
<Send.QueueMaxSize>134217728</Send.QueueMaxSize>
<Send.LogoutOnException>false</Send.LogoutOnException>
<Send.LogoutOnInvalidLogon>false</Send.LogoutOnInvalidLogon>
<Send.SpinningTimeout>1000</Send.SpinningTimeout>
<SetLastMsgSeqNumProcessed>true</SetLastMsgSeqNumProcessed>
<SetApplVerId>false</SetApplVerId>
<SupportNextExpectedMsgSeqNum>true</SupportNextExpectedMsgSeqNum>
<TcpNoDelay>false</TcpNoDelay>
<UpdateSendingTime>false</UpdateSendingTime>
<Validate.CheckSum>true</Validate.CheckSum>
<Validate.DuplicatedFields>true</Validate.DuplicatedFields>
<Validate.EmptyFieldValues>true</Validate.EmptyFieldValues>
<Validate.FieldValues>true</Validate.FieldValues>
<Validate.RepeatingGroupEntryCount>true</Validate.RepeatingGroupEntryCount>
<Validate.RepeatingGroupLeadingField>true</Validate.RepeatingGroupLeadingField>
<Validate.RequiredFields>true</Validate.RequiredFields>
<Validate.UnknownFields>true</Validate.UnknownFields>
<Validate.UnknownMessages>true</Validate.UnknownMessages>
<Versions>Fix42|Fix44</Versions>
<SSL.Protocol>Tls11|Tls12</SSL.Protocol>
</FixEngine>
</configuration>
JSON Configuration File Sample
{
"FixEngine": {
"DisableNetworkLevel": "true",
"Dictionary": "Dictionary1.xml|Dictionary2.xml|Dictionary3.xml",
"FileBasedStorage.SegmentSize": "1000",
"FileBasedStorage.IgnoreIntegrityErrors": "true",
"HeartbeatInterval": "60",
"License.Store": "License",
"License.AlertingDaysBeforeExpiration": "1024",
"ListenPort": "5555,6666,7777",
"LocalTimeUsage": "true",
"LocalNetworkInterface": "255.255.255.155",
"Log.Directory": "Log",
"Log.InboundMessages": "false",
"Log.OutboundMessages": "false",
"Log.BeforeSending": "false",
"MessageGrouping": "10",
"ProcessDeliverToCompId": "false",
"LogonTimeout": "10",
"LogoutTimeout": "10",
"Reconnect.Attempts": "32",
"Reconnect.Interval": "64",
"ReasonableTransmissionTime": "50",
"Receive.BufferSize": "32768",
"Receive.SpinningTimeout": "1000",
"Resending.QueueSize": "2000",
"Resending.BatchSize": "5000",
"ResendRequestMaximumRange": "256",
"Send.BufferSize": "32768",
"Send.QueueMaxSize": "134217728",
"Send.LogoutOnException": "false",
"Send.LogoutOnInvalidLogon": "false",
"Send.SpinningTimeout": "1000",
"SetLastMsgSeqNumProcessed": "true",
"SetApplVerId": "false",
"SupportNextExpectedMsgSeqNum": "true",
"TcpNoDelay": "false",
"UpdateSendingTime": "false",
"Validate.CheckSum": "true",
"Validate.EmptyFieldValues": "true",
"Validate.DuplicatedFields": "true",
"Validate.FieldValues": "true",
"Validate.RepeatingGroupEntryCount": "true",
"Validate.RepeatingGroupLeadingField": "true",
"Validate.RequiredFields": "true",
"Validate.UnknownFields": "true",
"Validate.UnknownMessages": "true",
"Versions": "Fix42|Fix44",
"SSL.Protocol": "Tls11|Tls12"
}
}