• Version 1.15.2
Show / Hide Table of Contents

XML-based Schedules and Connection Settings

In addition to the run-time configuration, the Session Scheduler also supports XML-based descriptions of schedules and connection settings.

To load these descriptions from the XML file, use the Scheduler(string) constructor. Later the descriptions could be referenced in the source code using their string identifiers.

For example:

Scheduler scheduler = new Scheduler("CmeILinkSchedule.xml");

scheduler.Register(session, "CME", "iLinkGateway");

The scheduler exposes Schedules and ConnectionSettings properties to access instances of schedules and connection settings described in the XML-based configuration file. This allows to combine XML-based and run-time configuration settings, for example:

scheduler.Register(session, scheduler.Schedules["ICE"], new InitiatorConnectionSettings("testing-evironment.ice.com", 8000));

Syntax

XML-based description of schedules and connection setting supports the following tags:

Tag Description
SchedulerSettings Root element
Schedules Collections of predefined schedules
Schedule Session schedule description
Connections Collection of predefined connection settings
Connection Connection settings description
Note

The XML Schema could be used to validate the configuration descriptions.

Session Schedule Description

Session Schedule description supports the following attributes for the <Schedule> element:

Attribute Values Notes
id A non-empty string Unique identifier for the schedule. Value of this attribute is used later in the source code to refer to the schedule. It must be unique among all schedules.
firstDay "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" The first day of the session working week.
lastDay "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" The last day of the session working week.
logonTime Time from 0:00 till 23:59 The session logon time.
logoutTime Time from 0:00 till 23:59 The session logout time.
sessionDuration "day", "week" Session's duration.
resetSessionNumber "never", "daily", "weekly" Sequence number reset policy.

Connection Settings Description

Connection Settings description supports the following attributes for the <Connection> element:

Attribute Values Notes
id A non-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 must be unique among all settings sets.
role "initiator", "acceptor" Session role
host String Counterparty host
port Number Counterparty port
heartbeatInterval Number Heartbeat interval
setResetSeqNumbers "false", "true" Option to set the ResetSeqNumFlag in the initial Logon message.
customLogonMessage String The custom Logon message. The field delimiter can be specified via the customLogonMessageFieldDelimiter attribute.
customLogonMessageFieldDelimiter String The field delimiter used in the customLogonMessage attribute. The default value is |.
customLogonMessageFile String The Logon message file to use. The field delimiter 0x01 is expected.

Sample

<?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>

        <!-- Acceptor has no parameters, so is no need to describe more than one acceptor. -->
        <Connection
          id="Acceptor"
          role="acceptor"
        />

    </Connections>

</SchedulerSettings>
In this article
Back to top Copyright © Onix Solutions.
Generated by DocFX