laminar_connectors/fix/mod.rs
1//! FIX TagValue source built on the QuickFIX C++ session engine.
2//!
3//! One source owns one initiator session. Inbound application messages are journaled inside the
4//! engine callback, and the session's store never persists an inbound sequence number past a
5//! record that is not yet durable; records are then projected from the journal into Arrow rows
6//! with deterministic `(session, journal index, row)` positions. Restart replays the journal from
7//! the committed checkpoint cursor; the session resumes from its store and the counterparty
8//! retransmits anything a crash lost.
9//!
10//! Supported: FIX.4.2/FIX.4.4 and FIXT.1.1 (one FIX 5.0 application version) initiator over
11//! loopback TCP or verified TLS, at-least-once or exactly-once with checkpointing, embedded and
12//! single-node deployments, and the Binance Spot drop-copy profile (Ed25519-signed Logon, no
13//! retransmission). Not supported (rejected before I/O): acceptor sessions, several
14//! application versions in one session, cluster placement, and outbound application messages.
15
16// FIX field and message names (MsgSeqNum, BodyLength, ExecutionReport) are protocol
17// vocabulary in prose, not code identifiers.
18#![allow(clippy::doc_markdown)]
19
20mod capture;
21mod config;
22mod dictionary;
23mod engine;
24#[cfg(feature = "fpml")]
25mod fpml;
26mod journal;
27mod metrics;
28mod projection;
29mod session_store;
30mod source;
31#[cfg(any(test, feature = "testing"))]
32pub mod testing;
33#[cfg(test)]
34mod tests;
35mod tls;
36mod venue;
37
38pub use source::FixSource;
39
40use std::sync::Arc;
41
42use crate::config::ConnectorInfo;
43use crate::error::ConnectorError;
44use crate::registry::ConnectorRegistry;
45use crate::schema::resolution::SchemaCapabilities;
46
47/// Native schema format recorded in FIX schema bindings.
48const NATIVE_FORMAT: &str = "fix-tagvalue";
49
50/// Register the `fix` source connector.
51///
52/// # Errors
53/// Returns an error if the source is already registered or the registry is frozen.
54pub fn register_fix_source(registry: &ConnectorRegistry) -> Result<(), ConnectorError> {
55 let info = ConnectorInfo {
56 schema_capabilities: SchemaCapabilities::declared(false),
57 name: "fix".to_string(),
58 display_name: "FIX Session Source".to_string(),
59 version: env!("CARGO_PKG_VERSION").to_string(),
60 is_source: true,
61 is_sink: false,
62 config_keys: config::config_keys(),
63 };
64 registry.register_source(
65 "fix",
66 info,
67 Arc::new(|registry| Ok(Box::new(FixSource::new(registry.cloned())))),
68 )
69}