-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Summary
Currently, send_app_message() rejects messages with SendError::Disconnected when the session is not connected. Traditional FIX engines (like QuickFIX) instead persist messages with sequence numbers regardless of connection state, relying on the FIX resend mechanism for delivery.
Current Behavior
send_app_message()checksis_connected()and returns error if false- Messages attempted while disconnected are rejected - no sequence number, not persisted
- Application must implement its own retry logic
Desired Behavior
- Messages should be persisted with sequence numbers in all session states
- When connected: message sent immediately on wire
- When disconnected/awaiting logon/awaiting logout: message persisted, delivered via
ResendRequestwhen peer reconnects and detects sequence gap - FIX protocol guarantees eventual delivery
Implementation Notes
The change is minimal because messages are already persisted BEFORE wire send in send_message():
- Remove
is_connected()check insend_app_message()(session.rs lines 800-802) - Change
error!todebug!inSessionState::send_message()for AwaitingLogon and Disconnected states (state.rs lines 91, 101) - Update
SendOutcome::Sentdocumentation to clarify "persisted" rather than "transmitted"
The existing resend_messages() mechanism handles delivery when the peer sends a ResendRequest.
Affected Files
crates/hotfix/src/session.rscrates/hotfix/src/session/state.rscrates/hotfix/src/session/error.rs(docs only)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels