Page tree
Skip to end of metadata
Go to start of metadata

Environment requirements

Hardware

Physical or virtual server with:

  • 2 core CPU
  • 2Gb RAM
  • 40G storage

Software

  1. FIXICC H2 machine:
    1. RHEL 7 / RHEL 8
    2. OpenJDK 1.8 
    3. Consul agent in client mode
  2. FIXEdge Java machine:
    1. Consul agent in client mode
  3. On the network:
    1. PostgreSQL Database
      1. 1 user with DDL privileges (to run the database migration, can also be used to run normal FIXICC H2 operation)
      2. (Optional) 1 user without DDL privileges (to run normal FIXICC H2 operation)
    2. Consul cluster (can be deployed on the same machines as FIXEdge Java or FIXICC H2)
  4. Client workstations:
    1. Chrome browser

Preconfiguration

Before you start work with the FIXICC H2 you should install and configure the FIX engine and Consul application.

Consul configuration

To find the Consul installation instructions please follow the link.

For non-production use, you can run Consul in developer mode with the command: consul agent -dev.

For production use - please follow the link.

To configure the encrypted connection from FIXICC H2 to Consul on the Consul side, please refer to the link.

FIX Engine

To control the FIX connections with the FIXICC H2, you should install and configure the FIX engine application.

The first version of FIXICC H2 communicates with FIXEdge Java.

For the detailed instructions on the installation and configuration FIXEdge Java please follow this link.

Also, you should set the additional configurations for FIXEdge Java:

NameExample valueDescription
rest.service.nameREST-AdminAPIThe name of REST service, if it is empty or disabled, REST service will not be available and registered in Service Discovery
rest.service.port9010The number of REST port, if it is empty or disabled, REST service will not be available and registered in Service Discovery
rest.ssl.cert.path/ssl/cert.pemThe path to the SSL certificate, should not be empty to create REST service and register it in Discovery
rest.ssl.key.path/ssl/key.pemThe path to the SSL key, should not be empty to create REST service and register it in Discovery
server.nameServerAThe name of the server, if it is not empty, the server will be registered in Discovery by this name. Otherwise, it will not be registered.
protocol.nameFIXThe name of the protocol, used for server registration in Consul
service.discovery.healthcheck.interval10Health check interval (Service Discovery)
service.discovery.attempt.period10000Service Discovery attempt period, milliseconds
fixicch2.urlhttp://10.68.21.181:8080Fixicch2 REST API to load fix session configs and to subscribe on session changes
fixicch2.url.prefixhttpFixicch2 URL prefix if Service Discovery is used to define IP and port
fixicch2.service.discovery.connection.timeout60000Timeout for attempts to connect to Service Discovery, mc
fixicch2.service.discovery.status.update.timeout10Max time to wait for Service Discovery Fixicc H2 health status update, min
server.useFixicch2ConfigManagertrueAllows to choose the sessionConfigManager and scheduleConfigManager (original or fixxicch2)
fixicch2.serviceFIXICC H2The name of FIXICC H2 service is used when the fixicch2.url is not set. If it is empty or disabled then the default value (FIXICC-H2) will be used for the connection
fixicch2.reconnect.pause2000Pause to reconnect to FIXICC H2 URL in case of errors, mc
The FIXEdge properties file example
# Name of REST service, if it is empty or disabled, REST service will not be available and registered in Service Discovery
rest.service.name=REST-AdminAPI
# Name of REST port, if it is empty or disabled, REST service will not be available and registered in Service Discovery
rest.service.port=9010
# Path to SSL certificate, should not be empty to create REST service and register it in Discovery
rest.ssl.cert.path=/ssl/cert.pem
# Path to SSL key, should not be empty to create REST service and register it in Discovery
rest.ssl.key.path=/ssl/key.pem
# Name of server, if it is not empty, server will be registered in Discovery by this name. Otherwise, it will not be registered.
server.name=ServerA
# Name of protocol, used for server registration in Service Discovery
protocol.name=FIX
# Health check interval (Service Discovery)
service.discovery.healthcheck.interval=10
# Service Discovery attempt period, milliseconds
service.discovery.attempt.period=10000
# Fixicch2 REST API to load fix session and schedules configs and to subscribe on session and schedules changes
fixicch2.url=http://10.68.21.181:8080
# Fixicch2 URL prefix if Service Discovery is used to define IP and port
fixicch2.url.prefix=http
# Timeout for attempts to connect to Service Discovery, mc
fixicch2.service.discovery.connection.timeout=60000
# Max time to wait Service Discovery Fixicc H2 health status update, min
fixicch2.service.discovery.status.update.timeout=10
# To use original sessionConfigManager and scheduleConfigManager beans set 'false' or comment it
# To use fixxicch2 session and schedule config managers set 'true'
server.useFixicch2ConfigManager=true
# Fixicch2 service name is used when the fixicch2.url is not set
fixicch2.service = FIXICC H2
# Pause to reconnect to FIXICC H2 URL in case of errors, mc
fixicch2.reconnect.pause=2000


After the FIXEdge Java configuration is completed and FIXEdge Java is started, the Consul application will add "REST-AdminAPI" and "FIX" services for the "ServerA" server to the service list.

You can see the example in the figure below:

Figure. The list of the configured services.

To run Consul UI, open browser page with address: localhost:8500.

The FIXICC H2 can have access to the configured services.

FIXICC H2 settings

You should choose a directory on your workstation for FIXICC H2 files.

You have your FIXICC H2 instance in app.jar file and to complete the configuration, please create the local.app.properties file.

You can place the app.jar file for the FIXICC H2 application and local.app.properties (FIXICC H2 properties file) in the same directory or store them separately.

Before you start your work, please set the database type for data storage.

FIXICC H2 is compatible with PostgreSQL databases.

Please configure the FIXICC H2 according to the instance of the local.app.properties in your FIXICC H2 package, set the following properties:

NameExample valueDescription
cuba.dbmsType postgresType of the RDBMS
cuba.dataSourceProvider application 

The value indicates that the data source must be configured using application properties

cuba.dataSource.username C##CUBA The user name for the database
cuba.dataSource.password cuba The password for the database
cuba.dataSource.dbName PTGSDB The database name
cuba.dataSource.host 10.68.21.182 Host for the database
cuba.dataSource.port 1521 Port for the database

fixicch2.consul.encrypted_connection

trueThe property enables the use of HTTPS

fixicch2.consul.port

8501The number of the port, configured for Consul

fixicch2.consul.insecure_connection_enabled

falseAllows accepting Consul insecure certificate. Is not recommended to set "true" in production mode


The FIXICC H2 properties file example
cuba.dbmsType = postgres
cuba.dataSourceProvider = application
cuba.dataSource.username = C##CUBA
cuba.dataSource.password =cuba
cuba.dataSource.dbName = PTGSDB 
cuba.dataSource.host = 10.68.21.182
cuba.dataSource.port =1521
fixicch2.consul.encrypted_connection =true
fixicch2.consul.port =8501
fixicch2.consul.insecure_connection_enabled =false

Service Discovery Configuration

To configure FIXICC H2 in Service Discovery you should add the fixicch2_app.json.

Example of the fixicch2_app.json
{
	"service":{
		"name":"FIXICC-H2",
		"port": 8080,
		"check":{	
			"http": "http://localhost:8080/app",
			"interval": "10s"
		}
	}
}

Logging configuration

To configure the logging level for the FIXICC H2 application, please create the logback.xml and locate it in the directory as the local.app.properties file locates.

The logback.xml file is not mandatory.

For further information please refer to the link.

Example of the logback.xml
<?xml version="1.0" encoding="UTF-8"?>

<configuration debug="false" packagingData="true">

    <property name="logDir" value="${app.home}/logs"/>

    <appender name="File" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${logDir}/app.log</file>

        <filter class="ch.qos.logback.classic.filter.ThresholdFilter">
            <level>INFO</level>
        </filter>

        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <!-- daily rollover -->
            <fileNamePattern>${logDir}/app.%d{yyyy-MM-dd}.log</fileNamePattern>
            <!-- keep 30 days' worth of history -->
            <maxHistory>5</maxHistory>
            <cleanHistoryOnStart>true</cleanHistoryOnStart>
        </rollingPolicy>

        <encoder>
            <pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread%X{cubaApp}%X{cubaUser}] %logger - %msg%n</pattern>
        </encoder>
    </appender>

    <root>
        <appender-ref ref="File"/>
    </root>
	
    <!-- Begin CUBA -->
    <logger name="com.haulmont.cuba" level="INFO"/>
    <logger name="com.haulmont.cuba.core.sys" level="INFO"/>
    <logger name="com.haulmont.cuba.core.sys.CubaDefaultListableBeanFactory" level="WARN"/>
    <logger name="com.haulmont.cuba.core.app.scheduling" level="INFO"/>
    <logger name="com.haulmont.cuba.web.sys" level="INFO"/>
    <logger name="com.haulmont.cuba.portal" level="INFO"/>
    <logger name="com.haulmont.restapi.sys" level="INFO"/>
    <logger name="com.haulmont.cuba.core.app.LockManager" level="INFO"/>
    <!-- End CUBA -->

    <logger name="eclipselink" level="WARN"/>
    <logger name="eclipselink.sql" level="INFO"/>
    <logger name="org.springframework" level="WARN"/>
    <logger name="com.vaadin" level="WARN"/>
    <logger name="org.atmosphere" level="WARN"/>
    <logger name="org.activiti" level="INFO"/>
    <logger name="org.jgroups" level="INFO"/>
    <logger name="freemarker" level="INFO"/>
    <logger name="org.thymeleaf.TemplateEngine" level="INFO"/>
    <logger name="com.zaxxer.hikari" level="INFO"/>
    <logger name="org.docx4j" level="WARN"/>
	<logger name="org.xlsx4j" level="WARN"/>
    <logger name="org.apache.fop.apps.FOUserAgent" level="WARN"/>
    <logger name="org.hibernate" level="WARN"/>
    <logger name="sun" level="INFO"/>
    <logger name="com.sun" level="INFO"/>
    <logger name="javax" level="INFO"/>
    <logger name="org.apache" level="INFO"/>
    <logger name="org.eclipse.jetty" level="INFO"/>
    <logger name="org.docx4j.utils.ResourceUtils" level="ERROR"/>
    <logger name="org.docx4j.Docx4jProperties" level="ERROR"/>
    <logger name="org.xlsx4j.jaxb.Context" level="ERROR"/>
    <logger name="org.docx4j.utils.XSLTUtils" level="ERROR"/>
    <logger name="org.docx4j.jaxb.JaxbValidationEventHandler" level="ERROR"/>
    <logger name="org.docx4j.TraversalUtil" level="ERROR"/>
    <logger name="org.docx4j.fonts" level="ERROR"/>

    <!-- Begin Perf4J  -->
    <appender name="PerfStatFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${logDir}/perfstat.log</file>
        <append>true</append>

        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${logDir}/perfstat.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>5</maxHistory>
            <cleanHistoryOnStart>true</cleanHistoryOnStart>
        </rollingPolicy>

        <encoder>
            <pattern>%msg%n</pattern>
        </encoder>
    </appender>

    <appender name="CoalescingStatistics" class="org.perf4j.logback.AsyncCoalescingStatisticsAppender">
        <param name="TimeSlice" value="60000"/>
        <appender-ref ref="PerfStatFile"/>
    </appender>

    <appender name="UIPerfStatFile" class="ch.qos.logback.core.rolling.RollingFileAppender">
        <file>${logDir}/perfstat-ui.log</file>
        <append>true</append>

        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
            <fileNamePattern>${logDir}/perfstat-ui.%d{yyyy-MM-dd}.log</fileNamePattern>
            <maxHistory>5</maxHistory>
            <cleanHistoryOnStart>true</cleanHistoryOnStart>
        </rollingPolicy>

        <encoder>
            <pattern>%msg%n</pattern>
        </encoder>
    </appender>

    <appender name="UICoalescingStatistics" class="org.perf4j.logback.AsyncCoalescingStatisticsAppender">
        <param name="TimeSlice" value="120000"/>
        <appender-ref ref="UIPerfStatFile"/>
    </appender>

    <logger name="org.perf4j.TimingLogger" additivity="false" level="INFO">
        <appender-ref ref="CoalescingStatistics"/>
    </logger>

    <logger name="com.haulmont.cuba.gui.logging.UIPerformanceLogger" additivity="false" level="INFO">
        <appender-ref ref="UICoalescingStatistics"/>
    </logger>
    <!-- End Perf4J  -->

</configuration>

Start application

You should start the FIXICC H2 from the command line with the following command:

java -Dapp.home=/opt/fixicch2-home -jar /opt/fixicch2/app.jar

Where:

  • "/opt/fixicch2-home" is the directory with the local.app.properties file, you should type full path for the file;
  • "/opt/fixicch2/" is the directory with the app.jar file, you should type the full path for the file.

HTTPS support

To enable HTTPS support on FIXICC H2 you need:

  1. Key and trust stores with TLS certificate and private key. Please refer to keytool  documentation for the details on generating key stores - keytool.
  2. Jetty configuration file with enabled HTTPS.
  3. Launch FIXICC H2 with an explicit path to the Jetty configuration: java -Dapp.home=/path/to/fixicch2-home -jar /path/to/app.jar -jettyConfPath /path/to/jetty.xml

Below are two examples of HTTPS configuration, for the details please refer to Jetty : The Definitive Reference.

Combined HTTP and HTTPS Example

An example Jetty configuration file with both HTTP and HTTPS enabled is below.

<Configure id="Server" class="org.eclipse.jetty.server.Server">
    <Call name="addConnector">
        <Arg>
            <New class="org.eclipse.jetty.server.ServerConnector">
                <Arg name="server">
                    <Ref refid="Server"/>
                </Arg>
                <Set name="port">8080</Set>
            </New>
        </Arg>
    </Call>
    <Call name="addConnector">
        <Arg>
            <New class="org.eclipse.jetty.server.ServerConnector">
                <Arg name="server">
                    <Ref refid="Server"/>
                </Arg>
                <Arg>
                    <New class="org.eclipse.jetty.util.ssl.SslContextFactory">
                        <Set name="keyStorePath">keystore.jks</Set>
                        <Set name="trustStorePath">keystore.jks</Set>
                    </New>
                </Arg>
                <Set name="port">8443</Set>
            </New>
        </Arg>
    </Call>
</Configure>

This configuration file enables HTTP server on port 8080 (line 8) and HTTPS on port 8443 (line 24) with key and trust stores (lines 20-21).

HTTPS-Only Example

<Configure id="Server" class="org.eclipse.jetty.server.Server">
    <Call name="addConnector">
        <Arg>
            <New class="org.eclipse.jetty.server.ServerConnector">
                <Arg name="server">
                    <Ref refid="Server"/>
                </Arg>
                <Arg>
                    <New class="org.eclipse.jetty.util.ssl.SslContextFactory">
                        <Set name="keyStorePath">keystore.jks</Set>
                        <Set name="trustStorePath">keystore.jks</Set>
                    </New>
                </Arg>
                <Set name="port">8443</Set>
            </New>
        </Arg>
    </Call>
</Configure>


  • No labels