To simplify development, Session Scheduler provides an ability to define session schedules and connecting settings in configuration files for later referencing in the source code.
Once presets are defined in the file, the session scheduler can use them during the instance initialization stage (OnixS::FIX::Scheduling::SessionSchedulerOptions class exposes OnixS::FIX::Scheduling::SessionSchedulerOptions::configurationFile member for these purposes). Afterwards, both schedules and connection settings can be referenced in the source code using the string identifiers. Scheduler exposes the OnixS::FIX::Scheduling::SessionScheduler::add overload to schedule a session with parameters described in a configuration file.
Moreover, OnixS::FIX::Scheduling::SessionScheduler exposes OnixS::FIX::Scheduling::SessionScheduler::findSchedule and OnixS::FIX::Scheduling::SessionScheduler::findConnectionSettings members to access real instances of schedules and connection settings described in the configuration file. These members can help when a session has to be registered with a partially predefined configuration.
The following example demonstrates how a session can be registered with a predefined schedule, but custom connection settings are not described in the configuration file.
Description of Scheduler settings has XML-based syntax. The following tags are supported:
Tag | Description |
---|---|
SchedulerSettings | Root element of scheduler's configuration. |
Schedules | Contains descriptions of predefined schedules. |
Schedule | Describes attributes of a particular session schedule. |
Connections | Contains descriptions of predefined session connection settings. |
Connection | Defines characteristics of a particular session connection. |
Session Schedule description consists in definition of the following attributes for the <Schedule>
element:
Attribute | Values | Notes |
---|---|---|
id | Non-empty String | It's a unique identifier for the schedule. The value of this attribute is used later in the source code to refer to the described schedule. It must be unique among all schedules. |
firstDay | Sunday , Monday , Tuesday , Wednesday , Thursday , Friday , Saturday | Defines the first day of the activity week for session. |
lastDay | Sunday , Monday , Tuesday , Wednesday , Thursday , Friday , Saturday | Defines the last day of the activity week for session. |
logonTime | Time value from 0:00 till 23:59 in 24 hours format (with optional seconds resolution). | Defines the time of logon for a session. |
logoutTime | Time value from 0:00 till 23:59 in 24 hours format (with optional seconds resolution). | Defines the time of logout for a session. |
sessionDuration | day , week | Defines, whether session continues the entire week, or the activity time frame is limited for a single day. |
resetSessionNumber | never , daily , weekly | Defines session sequence number reset policy. |
The description of connection settings consists of the definition of the following attributes for the <Connection>
element:
Attribute | Values | Notes |
---|---|---|
id | Non-empty String | It's a unique identifier for the settings set. The value of this attribute is used later in the source code to refer to described settings. It must be unique among all settings sets. |
role | initiator , acceptor | Specifies, whether session must be connected as acceptor or initiator. |
host | String | If a session must be logged on in the role of initiator, this parameter defines a remote host to which the session must connect to. Otherwise, the attribute is ignored. |
port | Number | If a session must be logged on in the role of initiator, this parameter defines a port number to which the session must connect to. Otherwise, the attribute is ignored. |
heartbeatInterval | Number | If a session must be logged on in the role of initiator, this parameter defines time interval between two heartbeat messages sent by session on the connection idle state. |
setResetSeqNumbers | false , true | If a session must be logged on in the role of initiator, this parameter defines, whether the session must include a special flag to the logon message for instructing counterparty how to reset session sequence numbers, once logon procedure is succeeded. |
customLogonMessage | String | If a session must be logged on in the role of initiator, this parameter defines FIX message to be used each time the scheduled session tries to logon to a counterparty. NOTE: Since <SOH> symbol can't be used in XML-based config, '|' symbol is used as message fields delimiter. |
customLogonMessageFieldDelimiter | String | Represents delimiter used to separate FIX fields (tag-value pairs) in custom logon message, defined by the |
customLogonMessageFile | String | If a session must be logged on in the role of initiator, this parameter defines the path to the file in which custom logon message is located. This message will be used each time the scheduled session tries to logon to a counterparty. It is ignored, if the |
<Counterparty>
nodes with host
and port
attributes. Inner nodes are ignored if master <Connection>
> node contains host
and port
attributes.Below is a typical configuration file for Sessions Scheduler.