Artio FIX Engine

repository·master·Indexed 43 days ago

https://github.com/artiofix/artio

A high-performance FIX (Financial Information eXchange) engine and library built on Aeron for low-latency messaging. It provides session management, SBE message encoding/decoding, message archiving, and replay capabilities. Features include Proxy Protocol v1 and v2 support, administrative control via AdminPublication, and specialized endpoints for receiving and sending FIX messages with built-in throttling and backpressure management.

Tokens
5K
Snippets
16
Records
33
Agent score
57%

What's inside Artio

  1. Implement FIXP Acceptor behaviors

    master

    Version 0.91 introduced a full suite of FIXP acceptor session-establishment behaviors, including:

    • Negotiating reject cases.
    • Handling duplicate session ID disconnections.
    • Managing no-logon/no-establish disconnects.
    • Re-establishment after restart or on renegotiate.
    • Sequence-number-index resets on renegotiate.

    Additionally, FIXP acceptors support:

    • Authentication strategies: With accept/reject flows.
    • Slow-consumer disconnect: A feature to disconnect slow consumers.
    • Retransmissions: Support for FIXP acceptor retransmissions when messages are being attempted simultaneously.
  2. Handle session timeouts and library liveness

    master

    Artio provides several mechanisms to monitor the health of the system:

    • FIX workflow as liveness indicator: In version 0.173, the FIX workflow can be used to act as a liveness indicator for both the engine and the library.
    • Session publishing on LibraryTimeout: In version 0.156, sessions are published upon a LibraryTimeout.
    • Liveness indicators: Version 0.172 added SeqIndexSync, ThrottleConfiguration, and ReleaseSessionReply as potential liveness indicators.
  3. Use Shared Codecs for multiple FIX dictionaries

    master

    Starting from version 0.105, Artio supports a major 'shared codecs' feature. This allows you to generate normalized codecs that are shared across multiple FIX dictionaries. This is useful for normalizing FIX 4.2 and 4.4 APIs.

    Key capabilities include:

    • Synthesizing components containing common fields.
    • Sharing components, groups (including nested groups), and enums.
    • Supporting duplicate or widened field types.
    • Collision detection between dictionaries.
    • Support for FIXT-style split dictionary configurations, including reversing component order when presenting duplicate field messages.
  4. Build Artio from source

    master

    To build Artio from the source repository, use the included Gradle wrapper. Running the standard Gradle build and install process will compile the project and prepare the environment.

    ./gradlew
  5. Migrate from ILink3MessageConsumer to FIXPMessageConsumer

    master

    In version 0.101, the following breaking changes were made to support the generic FIXP protocol abstraction:

    • Deprecated: ILink3MessageConsumer is deprecated. Use FIXPMessageConsumer instead.
    • Deprecated: PrintingILinkMessageConsumer is deprecated. Use FixPMessagePrinter instead.
    • New Support: Added support for using Binary Entrypoint with FixArchiveScanner and FixMessageLogger via a generic, allocation-free FIXP message pretty-printer.
  6. Download Artio binaries

    master

    Pre-compiled binaries for Artio are available on Maven Central. You can search for the artio artifact under the uk.co.real-logic namespace.

    https://central.sonatype.com/search?q=artio&namespace=uk.co.real-logic
  7. Configure the FixArchiveScanner

    master

    The FixArchiveScanner can be configured to improve scanning performance and manage log locations.

    Key configuration options introduced in 0.103:

    • Time-based index: Added to significantly speed up scanning.
    • log-file-dir: A new configuration option to specify the directory for log files used by the scanner.
  8. How FixReceiverEndPoint handles incoming data

    master

    The FixReceiverEndPoint is responsible for receiving data from TCP sockets, framing it into FIX messages, and publishing those messages as Aeron fragments.

    Key behaviors include:

    • Proxy Protocol Support: It automatically detects and parses both Proxy Protocol v1 and v2 to extract the original client address before processing FIX messages.
    • FIX Framing: It scans incoming byte streams for FIX message boundaries using standard tags (e.g., 8=FIX..., 9=BodyLength, 10=Checksum).
    • Authentication Flow: It enforces an authentication lifecycle. If a session is not yet authenticated (sessionId == UNKNOWN), it expects the first message to be a LOGON_MESSAGE_TYPE. If the first message is not a logon, it triggers a disconnect with DisconnectReason.FIRST_MESSAGE_NOT_LOGON.
    • Backpressure Management: The endpoint monitors backpressure from the Aeron publication. If Pressure.isBackPressured(position) returns true, the endpoint will stop processing and move remaining data back to the start of the buffer to be retried later.
    • Security: It uses a PasswordCleaner to sanitize sensitive data (like passwords in Logon messages) before saving them to the publication.
  9. Configure forced heartbeat intervals

    master
    Version 0.123 introduced a forced heartbeat configuration option. This is primarily intended to simplify testing by allowing you to control the frequency of heartbeats regardless of the standard protocol settings.
  10. Proxy Protocol support in FixReceiverEndPoint

    master

    The FixReceiverEndPoint supports transparently handling connections coming through a proxy (like HAProxy) using the Proxy Protocol. This allows the engine to see the actual client IP address instead of the proxy's IP.

    • Proxy v1: Detected by the PROXY signature. It parses the source address and port from a space-delimited ASCII line.
    • Proxy v2: Detected by a specific binary signature. It supports both IPv4 and IPv6 families and parses the address and port from a structured binary header.

    Once the proxy header is parsed, requiresProxyCheck is set to false, and the engine proceeds to frame standard FIX messages.

  11. Manage slow consumer disconnects

    master

    The endpoint monitors for slow consumers. If the buffer usage exceeds maxBytesInBuffer or if the slowConsumerTimeoutInMs is exceeded without successful writes, the endpoint will trigger a disconnect with the reason SLOW_CONSUMER via disconnectEndpoint(SLOW_CONSUMER).

    Users can check the current buffer status using:

    • isSlowConsumer(): Returns true if there are bytes currently buffered for reattempting.
    • bytesInBuffer(): Returns the current number of bytes in the buffer.