How to get the latest version of connectivity configuration files?
The latest version of connectivity configuration files available here.
Connectivity Configuration Structure
All public constructors of OnixS::ICE::iMpact::MarketData::Handler accepts the path to the connectivity configuration file as primary parameter. This file contains definitions of multicast groups and network addresses of corresponding servers to which the Handler have to connect to receive market data.
There are three major sections which make up the configuration: TCP connection information, Multicast groups, and Market types.
Shared Connection Settings
The Handler supports automatic reconnect for TCP connections and provides the following settings:
- timeoutInMilliseconds - the time interval in milliseconds to determine if data is not available in the TCP stream.
- reconnectTimeoutInSeconds - in case of reconnect this timeout in second will be used to delay the next connection. This is because ICE enforces new connections to be established minimum after 15 seconds of the last successful connection.
- maximumNumberOfReconnectAttempts - maximum number of reconnect attempts. If you want to reconnect until the connection is established please use -1. If you don't want to reconnect at all, please use 0.
The settings above can be specified in the connectivity configuration:
<tcp>
<settings>
<timeoutInMilliseconds>20000</timeoutInMilliseconds>
<reconnectTimeoutInSeconds>16</reconnectTimeoutInSeconds>
<maximumNumberOfReconnectAttempts>0</maximumNumberOfReconnectAttempts>
</settings>
</tcp>
Also, you can specify TCP settings using the OnixS::ICE::iMpact::MarketData::Handler::setTcpSettings method:
Handler handler(handlerSettings);
TcpSettings tcpSettings = handler.getTcpSettings();
tcpSettings.timeoutInMilliseconds = 20000;
tcpSettings.reconnectTimeoutInSeconds = 16;
tcpSettings.maximumNumberOfReconnectAttempts = 0;
handler.setTcpSettings(tcpSettings);
TCP Connection Information
TCP connection information section defines attributes of remote system to which server has to connect to request primary information like product definitions for selected markets. This section also defines login information like username and password which the Handler must supply to succeed with requests.
Typical TCP connection information section looks like the following:
<tcp>
<server name="ICE">
<ip>63.247.113.163</ip>
<port>3000</port>
<userName>Username from ICE</userName>
<password>Password from ICE</password>
<getStripInfoMessages>N</getStripInfoMessages>
<strategyPreference>New</strategyPreference>
<localNetworkInterface>eth0</localNetworkInterface>
<sslEnabled>Y</sslEnabled>
</server>
</tcp>
Values of ip and port attributes define connection to remote system. userName and password are the logon-related attributes.
getStripInfoMessages used as a flag to indicate whether the client wants to get Strip Info Messages or not. Y or N. It is N by default.
sslEnabled used to enable/disable SSL for TCP connection to ICE server. By default, SSL is enabled for Non-Production and disabled for Production.
How To Specify Username And Password Using API?
If you don't want to store username and password in the connectivity configuration file, please use the Handler's API. For example:
HandlerSettings settings;
settings.connectivityConfiguration = "ConnectivityConfiguration.AP1.xml";
Handler handler(settings);
handler.setTcpServerCredentials("ICE", "username", "password");
Defining Multicast Groups
Multicast groups section defines addresses of Multicast Price Feed channels for different types of books for a particular multicast group. Example below shows how single entry have to be defined:
<multicast>
<group name="ICE Futures US Agricultures">
<fullOrderDepth>
<live ip="233.156.208.255" port="20001"/>
<snapshot ip="233.156.208.254" port="20002"/>
</fullOrderDepth>
<priceLevel>
<live ip="233.156.208.253" port="20003"/>
<snapshot ip="233.156.208.252" port="20004"/>
</priceLevel>
</group>
</multicast>
Each group entry defines connection parameters for each type of book defined by the ICE iMpact specification. Therefore, connectivity configuration supposes existence of two entries in each group entry: fullOrderDepth and priceLevel. In own turn, each such entry must contain live and snapshot sub-entries which define connection information for corresponding Multicast Price Feed channel.
Market Types
Finally, Market types section defines the correspondence between multicast groups and types of markets which make up a particular group. Like, ICE Futures
Europe Oil group includes IPE Gas Oil Futures, IPE Brent Future, IPE Gas
Oil Futures Crack, and other market types. So, the section defines such kind of information.
The following sample depicts how association can be defined:
<allMarketTypes>
<marketType code="4" multicastGroup="ICE Futures Europe Oil">IPE Gas Oil Futures</marketType>
<marketType code="5" multicastGroup="ICE Futures Europe Oil">IPE Brent Futures</marketType>
<marketType code="6" multicastGroup="ICE Futures Europe Oil">IPE Gas Oil Futures Crack</marketType>
<allMarketTypes>
Typical Connectivity Configuration
Generally, a basic configuration file looks like the following:
<?xml version="1.0" encoding="utf-8"?>
<connectivityConfiguration>
<tcp
ip="63.247.113.163"
port="3000"
userName="Value from ICE Support"
password="Value from ICE Support"
getStripInfoMessages="N"
localNetworkInterface=""
/>
<multicast>
<group name="ICE Futures US (Liffe) Metals">
<fullOrderDepth>
<live ip="233.156.208.232" port="21231"/>
<snapshot ip="233.156.208.232" port="21230"/>
</fullOrderDepth>
<top5pl>
<live ip="233.156.208.232" port="21229"/>
<snapshot ip="233.156.208.232" port="21228"/>
</top5pl>
<fullOrderDepth implied="true">
<live ip="233.156.208.232" port="21199"/>
<snapshot ip="233.156.208.232" port="21198"/>
</fullOrderDepth>
<top5pl implied="true">
<live ip="233.156.208.232" port="21197"/>
<snapshot ip="233.156.208.232" port="21196"/>
</top5pl>
</group>
<group name="ICE Futures US (Liffe) Equity Indices">
<fullOrderDepth>
<live ip="233.156.208.232" port="21227"/>
<snapshot ip="233.156.208.232" port="21226"/>
</fullOrderDepth>
<top5pl>
<live ip="233.156.208.232" port="21225"/>
<snapshot ip="233.156.208.232" port="21224"/>
</top5pl>
</group>
<group name="ICE Futures US (Liffe) Options">
<top10pl>
<live ip="233.156.208.232" port="21187"/>
<snapshot ip="233.156.208.232" port="21186"/>
</top10pl>
<topOfBook>
<live ip="233.156.208.232" port="21185"/>
<snapshot ip="233.156.208.232" port="21184"/>
</topOfBook>
</group>
</multicast>
<allMarketTypes>
<marketType
code="206"
multicastGroup="ICE Futures US (Liffe) Metals"
optionsMulticastGroup="ICE Futures US (Liffe) Options">Metals</marketType>
<marketType
code="207"
multicastGroup="ICE Futures US (Liffe) Equity Indices"
optionsMulticastGroup="ICE Futures US (Liffe) Options">IFUS Equity Indices</marketType>
</allMarketTypes>
</connectivityConfiguration>