Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Environment requirements

Hardware

A 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 the client mode
  2. FIXEdge Cpp machine:
    1. Consul agent in the 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 the normal FIXICC H2 operation)
      2. (Optional) 1 user without DDL privileges (to run the normal FIXICC H2 operation)
    2. Consul cluster (can be deployed on the same machines as FIXEdge Cpp or FIXICC H2)
  4. Client workstations:
    1. Chrome browser

Preconfiguration

Before you start working 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.

FIXICC H2 settings

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

You have your FIXICC H2 instance in the app.jar file. 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 value

Default Value

Description
*cuba.dbmsType postgres

-

Type of the RDBMS
cuba.dataSourceProvider application 

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

true

false

The property enables the use of HTTPS

fixicch2.consul.port

8501

8500

The number of the port, configured for Consul

fixicch2.consul.insecure_connection_enabled

false

false

Allows accepting Consul insecure certificate. Is not recommended to set "true" in the production mode
fixicch2.fixServerTypeFIXEdge CPPall

Configures the type of the server to work with.

Allowed values: FIXEdge CPP, FIXEdge Java, any other value means two types of the supported servers.

* - marks the mandatory parameter


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
fixicch2.fixServerType = FIXEdge CPP


As well, the following parameters can be configurated through the "Application Properties" page on FIXICC H2:

NameExample value

Default Value

Description
fixicch2.fixServerTypeFIXEdge CPPall

Configures the type of the server to work with.

Allowed values: FIXEdge CPP, FIXEdge Java, any other value means two types of the supported servers.

fixicch2.maxTimeToWaitServerStatusUpdate1010Configures in minutes the max time slot for updating the server status from Consul. If there were no events during the period, then Consul sends the response. The maximum value is 10 minutes.
fixicch2.metricsUpdatePeriod11Configures in seconds the period for request the metrics from FIXEdge
fixicch2.modeproductionproductionMarks the instance of FIXICC H2
fixicch2.notificationTimeZoneUTCUTCSpecifies the time zone to display the time of the notification
fixicch2.pauseToReconnect20002000Specifies the pause between the reconnection attempts

Notice: If the parameters from the table above were configured in the local.app.properties file, values from the file would be applied despite values changed through the "Application Properties" page

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 the keytool  documentation for 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