SFS Transport Adaptor Integration Guide

Overview

The Simple FIX Socket Transport Adaptor (hereinafter SFS) is intended for communication with FIXEdge from third-part applications. The main goal of this adaptor is a quick and easy building of the network applications that may use full advantage of FIX Protocol.

Installation

SFS adaptor is distributed as a zip-archive with the name SFSAdaptor_xx.zip, where xx stands for SFS adaptor version. To install SFS adaptor unpack the .zip file and copy SFSAddinDll.dll into the FIXEdge's \bin folder.

Several instances of SFS TA can be created without copying the shared library since FIXEdge C++ 6.14.0.

See the sections Configuration in order to learn how to configure SFS adaptor. After the SFS adaptor is configured the FIXEdge needs to be started.

Configuration

SFS adaptor is configured using the following properties:

Property name

Description

TransportLayer.SFSAdaptorDLL.DllName

Contains path and name of the SFS adaptor dll. In case this parameter is not specified, the TransportLayer.SFSAdaptorDLL.AdapterId is applied to define the adapter's library by ID.

Property is required.

Several instances of SFS TA can be created using the same shared library since FIXEdge C++ 6.14.0.

TransportLayer.SFSAdaptorDLL.AdapterId

The parameter to define the adapter's library by ID. In case this parameter is not specified, or TransportLayer.SFSAdaptorDLL.DllName parameter is specified too, the TransportLayer.SFSAdaptorDLL.DllName is applied

This parameter is applicable since FIXEdge C++ version 6.14.0

Required value: SFS

TransportLayer.SFSAdaptorDLL.Description

Name of adaptor. Property is required.

TransportLayer.SFSAdaptorDLL.Type

Type of the adaptor library, has contains value 'DLL'. Property is required.

TransportLayer.SFSAdaptorDLL.ListenPort

Listen port, that SFS adaptor use to accept client's connections. Integer value, should be > 0. Property is required.

TransportLayer.SFSAdaptorDLL.NumberOfWorkers

Amount of the workers threads that concurrently handle client's messages. Integer value, should be > 0. Property is required.

TransportLayer.SFSAdaptorDLL.LogEnableTimestamp

Enable timestamp in the messages logging. By default value is ‘true’.

TransportLayer.SFSAdaptorDLL.LogUTCTimestamp

UTC format of timestamp in the messages logging. By default value is ‘false’, outputs in local time.

TransportLayer.SFSAdaptorDLL.AcceptConnectionsFromIP

Contains IP addresses of the acceptable connections. Property is optional.

TransportLayer.SFSAdaptorDLL.Sessions

Contains enumeration of registered SFS clients. Property is required.

TransportLayer.SFSAdaptorDLL.<ClientName>.LogDirectory

Absolute or relative path where incoming and outgoing messages will be logged to “*.in” and “.out” files accordingly. All relative values of path will be added toFIXEdge.RootDir directory.

TransportLayer.SFSAdaptorDLL.<ClientName>.SmartXmlMessageHandling

Enables mode of FIXML messages handling; must equal ‘true’ or ‘false’.

If mode enabled:

* For each outgoing FIX message type “n”, <213=XML Data> tag of (XML message) will be extracted; only FIXML data will be sent to SFS client.

* For each incoming from SFS client data that represent as FIXML will be packed into 213 tag of “n” message. By default value is ‘false’.

TransportLayer.SFSAdaptorDLL.<ClientName>.FileSession

For file output only. If parameter is ‘true’ then all outgoing messages will not be send to session. By default value is ‘false’.

Note: Set SmartXmlMessageHandling to ‘true’ for logging of extracted XML data from outgoing “n” messages.

TransportLayer.SFSAdaptorDLL.<ClientName>.SplitLogRecordsToFiles

For file output only. If parameter is ‘true’ then each message will be logged into separate file with unique name. By default value is ‘false’.

Note: Set SmartXmlMessageHandling to ‘true’ for logging of extracted XML data from outgoing “n” messages.

Note that all changes in properties file are applied only after FIXEdge restart.

To integrate SFS adaptor into the FIXEdge, the following steps have to be executed:

  1. Open FIXEdge properties file (FIXEdge.properties by default).
  2. Find 'TransportLayer.TransportAdapters' property
    1. Add 'TransportLayer.TransportAdapters' property in case it doesn't exist
  3. Set 'TransportLayer.SFSAdaptorDLL' to the value of the 'TransportLayer.TransportAdapters' property:

    TransportLayer.TransportAdapters = TransportLayer.SFSAdaptorDLL
    1. If 'TransportLayer.TransportAdapters' property already has value - append ',TransportLayer.SFSAdaptorDLL' to the value:
    TransportLayer.TransportAdapters = ...,TransportLayer.SXSAdaptorDLL,TransportLayer.SFSAdaptorDLL
  4. Add property 'TransportLayer.SFSAdaptorDLL.Description' with value - SFS adaptor name:

    TransportLayer.SFSAdaptorDLL.Description = SFS Transport Adaptor DLL
  5. Add property 'TransportLayer.SFSAdaptorDLL.DllName' with value - path to the SFS adaptor dll:

    TransportLayer.SFSAdaptorDLL.DllName = bin/SFSAddinDll.dll
  6. Add property 'TransportLayer.SFSAdaptorDLL.Type' with value 'DLL':

    TransportLayer.SFSAdaptorDLL.Type = DLL
  7. Add property 'TransportLayer.SFSAdaptorDLL.ListenPort' with value - port where SFS adaptor will accept incoming connections:

    TransportLayer.SFSAdaptorDLL.ListenPort = 8145
  8. Add property 'TransportLayer.SFSAdaptorDLL.NumberOfWorkers' with value - thread's amount that handles connections:

    TransportLayer.SFSAdaptorDLL.NumberOfWorkers = 10
  9. Add property 'TransportLayer.SFSAdaptorDLL.SFSClientName.LogDirectory ' with value – path to incoming and outgoing messages logging:

    TransportLayer.SFSAdaptorDLL.SFSClientName.LogDirectory =FixEdge1/log
  10. Restart FIXEdge to apply changes

After changes the FIXEdge properties file may look like this:

....
#------------------------------------------------------------
# Transport Layer Section
#------------------------------------------------------------
TransportLayer.TransportAdapters = TransportLayer.SFSAdaptorDLL

....
#------------------------------------------------------------
# SFS Adaptor settings
#------------------------------------------------------------
# SFS adaptor name
TransportLayer.SFSAdaptorDLL.Description = SFS Transport Adaptor DLL
# Contains path and name of the SFS adaptor dll. Property is required 
TransportLayer.SFSAdaptorDLL.DllName = ./SFSAddinDll.dll
# Type of the adaptor library, has contains value 'DLL'. Property is required 
TransportLayer.SFSAdaptorDLL.Type = DLL
# Listen port, that SFS adaptor use to accept client's connections. Integer value, should be > 0. Property is required 
TransportLayer.SFSAdaptorDLL.ListenPort = 8444
# Amount of the workers threads that concurrently handle client's messages. Integer value, should be > 0. Property is required 
TransportLayer.SFSAdaptorDLL.NumberOfWorkers = 10
# Absolute or relative path where incoming and outgoing messages will be logged to "*.in" and ".out" files accordingly. All relative values of path will be added to FIXEdge.RootDir directory. Property is optional. By default accept value of FIXEdge.RootDir
TransportLayer.SFSAdaptorDLL.NumberOfWorkers = 10
....

Administration

SFS adaptor supports Administrative interface with action 'close_session':

Cases of XML commands using:

<?xml version="1.0" encoding="UTF-8"?>
<Action Name="CLOSE_SESSION" Target="FixEdge:Transport:ADMFIXED">
<Params>
<Param Name="ADAPTOR" Value="SFSAdaptorDLL"/>
<Param Name="CLIENT " Value="SFSClient"/>
</Params>
</Action>

FEAdminConsole command line example:

FEAdminConsole -ADAPTOR_EXEC -adaptor SFSAdaptorDLL -command CLOSE_SESSION -client SFSClient

Monitoring (viewing logs)

SFS adaptor puts log messages into the FIXEdge log. Besides adaptor always creates “SFSClientName-*.in” and “SFSClientName-*.out” files for logging of incoming or outgoing messages accordingly. Adaptor creates log files in the directory that is specified in LogDirectory parameter, it may be absolute or relative path in theFIXEdge.RootDir parameter.

Each record in the log is separated by linefeed and timestamp in form “YYYYMMDD-HH:MM:SS.sss : ”. But timestamp may be disabled in the records by option LogEnableTimestamp = false. Timestamp has local time by default. Use LogUTCTimestamp to enable UTC time format.

SFS adaptor can create a simple file session without message sending into socket by specifying parameter FileSession = true. All outgoing messages will be logged in “SFSClientName-*.out”, but not sent to SFS client. If SmartXmlMessageHandling mode is enabled then XML data will be extracted from FIXML messages (MsgType = “n”, tag 213) into outgoing log.

  1. Open FIXEdge property file
  2. Add property 'SFSAdaptor.SFSClientName.LogDirectory' with value - path to incoming and outgoing messages logging:

    TransportLayer.SFSAdaptor.SFSClient.LogDirectory = FIXEdge1/log
  3. Add property ‘SFSAdaptor.SFSClientName.FileSession’ with value – ‘true’ to enable file session mode:

    TransportLayer.SFSAdaptor.SFSClient.FileSession = true
  4. Add property ’SFSAdaptor.SFSClientName.SmartXmlMessageHandling’ with value – ‘true’ to enable the XML data extracting from FIXML messages (MsgType = “n”):

    TransportLayer.SFSAdaptor.SFSClient.SmartXmlMessageHandling = true
  5. Restart FIXEdge

When SFS adaptor starts successfully the following record will be written into the log file (xxx - the version of the SFS adaptor):

[NOTE] 20070215-11:20:12.437 - SFS Adaptor v.xxx started.