FixAlchemy.Engine.Validation (FIXAlchemy v0.3.0)
View SourceSession-level checks an acceptor applies to every inbound message.
validate/3 reports the first problem it finds, in the order the session
protocol prescribes: BeginString, MsgType, tag validity, required tags, comp
ids, then SendingTime.
Checks run only when a session sets validate_inbound: true.
Outcomes
:ok- the message may be processed{:reject, problem}- answer with a Reject (35=3) built fromproblem, and end the session afterwards whenproblem.disconnect?is true{:logout, text}- answer with a Logout carryingtextand end the session; the counterparty is speaking a different protocol version, so a Reject would not be understood
problem.reason is the SessionRejectReason (tag 373) to send, and
problem.ref_tag the RefTagID (tag 371) when one tag is at fault.
Summary
Functions
Check one inbound message.
Types
@type problem() :: %{ reason: non_neg_integer(), text: binary(), ref_tag: pos_integer() | nil, disconnect?: boolean() }
@type session() :: %{ :fix_version => binary(), :sender_comp_id => binary(), :target_comp_id => binary(), :spec_modules => [module()], optional(:max_latency) => pos_integer() }