Code Monkey home page Code Monkey logo

fixio's Introduction

fixio - FIX Protocol Support for Netty Build Status

Overview

Why One More FIX Protocol API

This API is intended to replace well known QuickFIX/J in high-frequency trading scenarios.

Design goals

  1. Implement FIX Protocol Java API with as low memory footprint as possible in order to eliminate unnecessary GC overhead, thus improving overall application performance under high load.
  2. Provide FIX Protocol Codecs for Netty, to make it possible to get rid of Apache Mina which is used by QuickFIX/J as a transport layer.
  3. Avoid using expensive operations:
    • Avoid synchronization.
    • Replace BigDecimals with custom Fixed Point Number implementation for financial data.
    • Reuse java.util.Calendar and java.util.TimeZone instances.

The API has a number of limitations, so it may be not suitable for any FIX application.

Limitations

  1. Logon message encryption is not supported. EncryptMethod(98)=0
  2. XmlData is not supported
  3. Message encodings other than US-ASCII are not supported.
  4. Message resending and resend requests are not supported.
  5. ...

Performance

Currently fixio can beat QuickFix performance in simple scenario. See performance comparison.

Getting Started

  1. Download ZIP archive or clone/fork the repository.
  2. Build and install project artifacts to your local maven repository: mvn clean install
  3. Add the dependency to your project
<dependency>
    <groupId>kpavlov.fixio</groupId>
    <artifactId>core</artifactId>
    <version>1.1-SNAPSHOT</version>
</dependency>

You'll also need a slf4j API implementation at runtime, so please add appropriate dependency, e.g.:

<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>1.7.10</version>
    <scope>runtime</scope>
    <optional>true</optional>
</dependency>

Examples

You may find working example of client and server applications in module "examples".

I recommend running server with Concurrent Mark Sweep Collector enabled: -XX:+UseConcMarkSweepGC and increased Survivor spaces (-XX:SurvivorRatio=4).

Writing Simple FIX Client

To create a simple FIX client you need to:

  1. Implement FixApplication. You may extend FixApplicationAdapter as a quick start.

  2. Create an instance of FixClient and initialize if with FixApplication you've just created and classpath reference to FIX session settings property file.

  3. Invoke FixClient.connect(host, port) to initiate connection. Method connect(...) returns a ChannelFeature which which will be notified when a channel is closed, so you may invoke the method sync() on it if you wish to wait for connection to be closed.

FixApplication app = new FixApplicationAdapter();
client = new FixClient(app);

// set settings file location related to classpath
client.setSettingsResource("/client.properties");

// connect to specified host and port
ChannelFeature closeFeature = client.connect("localhost", 10201);

// wait until FIX Session is closed
closeFeature.sync();

// Shutdown FIX client
client.disconnect();

You may find more information in User Guide and Wiki pages.

fixio's People

Contributors

kpavlov avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.