A minimal auction service demonstrating:
- Aeron Cluster for fault-tolerant, replicated state management
- Artio with iLink3/FIXP for high-performance FIX protocol connectivity
- SBE (Simple Binary Encoding) for efficient message serialization
┌─────────────────────────────────────────────────────────────┐
│ Cluster Client │
│ (AuctionClusterClient) │
│ - Direct SBE message submission │
└───────────────────────────┬─────────────────────────────────┘
│ Aeron UDP
▼
┌─────────────────────────────────────────────────────────────┐
│ Aeron Cluster (Single Node) │
│ ┌─────────────────────────────────────────────────────┐ │
│ │ AuctionClusteredService │ │
│ │ - Handles PlaceOrder/CancelOrder messages │ │
│ │ - Maintains deterministic AuctionState │ │
│ │ - Matches orders and broadcasts results │ │
│ │ - Supports snapshotting for recovery │ │
│ └─────────────────────────────────────────────────────┘ │
└─────────────────────────────▲───────────────────────────────┘
│ Aeron UDP
│
┌─────────────────────────────┴───────────────────────────────┐
│ iLink3 Gateway │
│ (ILink3Gateway + ClusterGatewayAdapter) │
│ - Accepts iLink3/FIXP connections from clients │
│ - Translates FIX NewOrderSingle ↔ SBE PlaceOrder │
│ - Bridges external FIXP clients to cluster │
└───────────────────────────▲─────────────────────────────────┘
│ iLink3/FIXP
│
┌─────────────────────────────────────────────────────────────┐
│ iLink3 Test Client │
│ (ILink3TestClient) │
│ - Connects via Artio iLink3 initiator │
│ - Sends FIX NewOrderSingle messages │
│ - Demonstrates end-to-end FIXP integration │
└─────────────────────────────────────────────────────────────┘
aeron-test/
├── build.gradle # Gradle build with dependencies
├── src/main/
│ ├── java/com/example/auction/
│ │ ├── cluster/
│ │ │ ├── AuctionClusterNode.java # Single-node cluster launcher
│ │ │ └── AuctionClusteredService.java # ClusteredService implementation
│ │ ├── gateway/
│ │ │ ├── ClusterGatewayAdapter.java # Cluster client for gateway
│ │ │ ├── ILink3Gateway.java # iLink3/FIXP acceptor bridge
│ │ │ └── ILink3TestClient.java # iLink3 test client (initiator)
│ │ ├── state/
│ │ │ ├── AuctionState.java # Deterministic order book
│ │ │ └── Order.java # Order entity
│ │ ├── client/
│ │ │ └── AuctionClusterClient.java # Direct cluster test client
│ │ └── messages/ # (Generated) SBE codecs
│ └── resources/
│ ├── sbe/
│ │ └── auction-messages.xml # SBE message schema
│ ├── ilink3/
│ │ └── ilink3-schema.xml # iLink3 message definitions
│ └── logback.xml
- Java 21+
- Gradle 8+
# Generate SBE codecs and compile
./gradlew buildThis will:
- Generate SBE encoder/decoder classes from
auction-messages.xml - Compile all Java sources
- Run tests
In one terminal:
./gradlew run -PmainClass=com.example.auction.cluster.AuctionClusterNodeThis starts the single-node Aeron Cluster with the AuctionClusteredService.
In another terminal:
./gradlew run -PmainClass=com.example.auction.client.AuctionClusterClientThis runs AuctionClusterClient which:
- Connects to the cluster
- Places buy and sell orders
- Demonstrates order matching
- Shows cancel functionality
In a third terminal:
./gradlew run -PmainClass=com.example.auction.gateway.ILink3GatewayThe gateway:
- Connects to the cluster as a client
- Accepts iLink3/FIXP connections from external clients
- Translates between iLink3 messages and cluster SBE messages
- Demonstrates FIX protocol integration
In a fourth terminal:
./gradlew run -PmainClass=com.example.auction.gateway.ILink3TestClientThis test client:
- Connects to the iLink3 gateway using the FIXP protocol
- Sends NewOrderSingle messages via iLink3
- Demonstrates end-to-end flow: iLink3 → Gateway → Cluster
| Message | ID | Direction | Description |
|---|---|---|---|
| PlaceOrder | 1 | Client → Cluster | Submit a buy/sell order |
| CancelOrder | 2 | Client → Cluster | Cancel an existing order |
| OrderResponse | 3 | Cluster → Client | Ack/reject/fill notification |
| AuctionResult | 4 | Cluster → Clients | Broadcast when orders match |
The AuctionState class maintains order book state deterministically:
- Uses
TreeMapfor predictable iteration order - All time-based decisions use cluster-provided timestamps
- No external I/O or random operations
AuctionClusteredService implements:
onTakeSnapshot()- Serializes all orders to the snapshot- Snapshot loading in
onStart()- Restores state on recovery
Simple price-time priority matching:
- Buy orders sorted by price descending (best bid first)
- Sell orders sorted by price ascending (best offer first)
- Match occurs when best bid ≥ best offer
- Match price is midpoint of crossing prices
Cluster endpoints (in AuctionClusterNode.java):
- Ingress:
localhost:20110 - Egress:
localhost:20220
iLink3 Gateway (in ILink3Gateway.java):
- FIXP acceptor:
localhost:9880 - Session ID:
TESTSESS - Firm ID:
TESTFIRM
This implementation demonstrates:
- iLink3 Gateway acting as an acceptor for external FIXP clients
- iLink3 Test Client using Artio's initiator to connect via FIXP
- Translation between FIX NewOrderSingle (tag 35=D) and cluster SBE PlaceOrder messages
- Session management with Establish/Terminate sequences
The ILink3Gateway shows how to bridge FIX protocol clients to the Aeron Cluster using Artio's iLink3 support, providing a practical example of integrating traditional FIX-based systems with modern low-latency infrastructure.
# Remove cluster data
rm -rf aeron-cluster/ artio-logs/io.aeron:aeron-all- Aeron transport and clusteruk.co.real-logic:artio-*- Artio FIX/FIXP engineuk.co.real-logic:sbe-tool- SBE code generatororg.agrona:agrona- High-performance data structures