forwardSession Schedule   Table of ContentFailoverforward
Predefined Schedules and Connection Settings

To simplify development, the Session Scheduler provides an ability to define session schedules and connection settings in configuration files for later referencing in source code.

Once presets are defined in the file, the session scheduler can use them during the instance initialization stage (the Scheduler(String) constructor is available for these purposes). Afterwards, both schedules and connection settings can be referenced in source code using the string identifiers. Scheduler exposes the Register(Session, String, String) overload to schedule a session with parameters described in a configuration file.

Example
C#
void RegisterSessionWithPredefinedSettings()
{
    scheduler.Register(sessionWithCurrenex, "Currenex", "Currenex");
}
VB
Private Sub RegisterSessionWithPredefinedSettings()
    scheduler.Register(sessionWithCurrenex, "Currenex", "Currenex")
End Sub

Moreover, Scheduler exposes Schedules and ConnectionSettings properties to access real instances of schedules and connection settings described in configuration file. These members come in help when session has to be registered with partially predefined configuration.

Example

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.

C#
void RegisterSessionWithPartlyDefinedConfiguration()
{
    scheduler.Register(
        testingEnvironmentSession,
        scheduler.Schedules["ICE"],
        new InitiatorConnectingSettings("testing-evironment.ice.com", 8000));
 }
VB
Private Sub RegisterSessionWithPartlyDefinedConfiguration()
    scheduler.Register(testingEnvironmentSession, scheduler.Schedules("ICE"), New InitiatorConnectingSettings("testing-evironment.ice.com", 8000))
End Sub

Sometimes a session's counterparty may be out of service, causing session logon failure. Some systems provide secondary servers, which can be connected while primary servers are down. To support such cases, InitiatorConnectionSettings class exposes the Counterparties property, which allows defining secondary servers, that will be connected in case of the connection failure to the primary server. Also, Scheduler remembers last good connection settings (counterparty). Therefore, since the next time connection must be established, it will use last good configuration.

Configuration File Reference

Description of Scheduler settings has XML-based syntax. The following tags are supported:

TagDescription
SchedulerSettingsRoot element of scheduler's configuration.
SchedulesContains descriptions of predefined schedules.
ScheduleDescribes attributes of particular session schedule.
ConnectionsContains descriptions of predefined session connection settings.
ConnectionDefines characteristics of particular session connection.

Note Note
Scheduler settings configuration is validated by the schema available on Corporate Website .

Defining Session Schedule

Session Schedule description consists of definition of the following attributes for the <Schedule> element:

AttributeValuesNotes
idNon-empty string. Unique identifier for the schedule. Value of this attribute is used later in source code to refer to 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 the session.
lastDay"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday".Defines the last day of the activity week for the session.
logonTimeTime value from 0:00 till 23:59 in arbitrary format (12 or 24 hours).Defines time of logon for session.
logoutTimeTime value from 0:00 till 23:59 in arbitrary format (12 or 24 hours).Defines time of logout for session.
sessionDuration"day", "week".Defines whether a session continues an entire week, or the activity time frame is limited for single day.
resetSessionNumber"never", "daily", "weekly".Defines session sequence number reset policy.

Defining Session Connection Settings

Description of connection settings consists of the definition of the following attributes for the <Connection> element:

AttributeValuesNotes
idNon-empty string. Unique identifier for the settings set. The value of this attribute is used later in the source code to refer to described settings. It M\must be unique among all settings sets.
role"initiator", "acceptor".Specifies whether session must be connected as an acceptor or initiator.
hostString 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.
portNumber If a session must be logged on in the role of initiator, this parameter defines a port number to which session must connect to. Otherwise, the attribute is ignored.
heartbeatIntervalNumber If a session must be logged on in role of initiator, this parameter defines the time interval between two heartbeat messages sent by the session on 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 logon message. In this case, it instructs counterparty to reset session sequence numbers, once logon procedure is succeeded.
customLogonMessageString Specifies the inline FIX logon message to use. The field delimiter can be specified in the 'customLogonMessageFieldDelimiter' attribute.
customLogonMessageFieldDelimiterString Specifies the field delimiter used in the 'customLogonMessage' attribute. Default value is '|'.
customLogonMessageFileString Specifies the FIX logon message file/resource to use. The field delimiter '0x01' is expected.

Example

A typical configuration file for the Sessions Scheduler is below.

<?xml version="1.0" encoding="utf-8" ?>              
<SchedulerSettings
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://ref.onixs.biz/fix/scheduler http://ref.onixs.biz/fix/scheduler/scheduler-settings-1.6.xsd"
  xmlns="http://ref.onixs.biz/fix/scheduler">

  <Schedules>

    <Schedule   
      id="CME" 
      firstDay="Sunday"
      logonTime="18:00" 
      lastDay="Friday"
      logoutTime="16:00" 
      sessionDuration="week" 
      resetSessionNumber="weekly"
    />  

    <Schedule 
      id="SimpleDaily" 
      firstDay="Monday"
      lastDay="Friday"
      logonTime="08:00" 
      logoutTime="17:00" 
      sessionDuration="day" 
      resetSessionNumber="weekly"
      />

    <Schedule
      id="SimpleWeekly"
      firstDay="Monday"
      lastDay="Friday"
      logonTime="08:00"
      logoutTime="17:00"
      sessionDuration="week"
      resetSessionNumber="weekly"
      />

    <Schedule
      id="DailyWithMidnightCross"
      firstDay="Monday"
      lastDay="Friday"
      logonTime="21:00"
      logoutTime="03:00"
      sessionDuration="day"
      resetSessionNumber="daily"
      />

    <Schedule
      id="WeeklyWithMidnightCross"
      firstDay="Monday"
      lastDay="Friday"
      logonTime="21:00"
      logoutTime="03:00"
      sessionDuration="week"
      resetSessionNumber="never"
      />

    <Schedule
      id="AllWeek"
      firstDay="Sunday"
      lastDay="Saturday"
      logonTime="0:00"
      logoutTime="23:59:00"
      sessionDuration="week"
      resetSessionNumber="never"
      />

    <Schedule
      id="DailyWithDailySeqNumberReset"
      firstDay="Monday"
      lastDay="Friday"
      logonTime="8:00"
      logoutTime="17:00"
      sessionDuration="day"
      resetSessionNumber="daily"
      />

    <Schedule
      id="DailyWithWeeklySeqNumberReset"
      firstDay="Monday"
      lastDay="Friday"
      logonTime="8:00"
      logoutTime="17:00"
      sessionDuration="day"
      resetSessionNumber="weekly"
      />

  </Schedules>

  <Connections>
    <Connection 
        id="LocalInitiator" 
        role="initiator"
        >
        <Counterparty host="localhost" port="4500"/>
    </Connection>
    <Connection 
        id="InitiatorToTestingEnvironment" 
        role="initiator" 
        setResetSeqNumbers="true"
        >
        <Counterparty host="testing-evn.privatedomain.com" port="8000"/>
    </Connection>      
    <Connection 
        id="MultiTargetInitiator" 
        role="initiator" 
        setResetSeqNumbers="true" 
        heartbeatInterval="45">
        <Counterparty host="primary.domain.com" port="4600"/>
        <Counterparty host="secondary.domain.com" port="4500"/>
    </Connection>
    <Connection 
      id="InitiatorWithCustomLogonMessage"
      role="initiator"
      customLogonMessage="8=FIX.4.2|9=0|35=A|141=Y|5001=TraderId|10=000|"
      host="localhost" 
      port="4500">
    </Connection>
    <Connection 
      id="InitiatorWithCustomLogonMessageAndFieldDelimiter"
      role="initiator"
      customLogonMessage="8=FIX.4.2*9=0*35=A*141=Y*10=000*"
      customLogonMessageFieldDelimiter="*"
      host="localhost"
      port="4500">
    </Connection>  
    <!-- Since acceptor has no parameters, there is no need in describing more than one acceptor. -->
    <Connection
      id="Acceptor"
      role="acceptor"
      />
  </Connections>
</SchedulerSettings>