The main FIX Antenna components are:
FixServer
- listens for incoming connectionsIFixServerListener
- listener for incoming connections. TheNewFixSession(IFixSession session)
method is called for every new connection andsession.Connect()
should be called to accept a connection. Thesession.ConnectAsync()
method also extsts.IFixSessionListener
- listener for new messages and session state changesFixMessage
- a list ofTagValue
that could be either FIX message or FIX message contentIFixSession
- either a FIX Session acceptor or initiator capable of sending/receiving messagesIFixSessionFactory
- session factory for the initiatorIErrorHandler
- error and warning condition listener (not required but recommended for production applications)IMessageValidator
- validates the current message
FixServer
is needed to accept incoming connections. It starts to listen for incoming connections after the Start()
method.
After the Stop()
method, the server stops listening but the application does not stop until all
sessions are disconnected. To be able to accept incoming sessions, IFixServerListener
should be set.
void NewFixSession(IFixSession session)
is executed for every new connection. If session.Connect()
is not called in
this method then connection is rejected. To process messages, call session.SetFixSessionListener(IFixSessionListener listener)
.
Contains two methods:
void OnSessionStateChange(SessionState sessionState)
- called when session state is changedvoid OnNewMessage(FixMessage message)
- called for every incoming application message
The FIX session is represented by the IFixSession
interface. This interface is responsible for:
- Managing the session state
- Sending outgoing application-level messages
Each session incapsulates a message storage that is used to store the sent and received messages and a queue. A session could be configured to use memory or files on disk to store/queue messages. File storage is reliable and fault tolerant. Memory storage is much faster, but not fault tolerant.
A FIX message may contain repeating groups. Each group contains:
- Leading tag that contains the number of repeating group entries.
- Repeating group entries.
- At least one tag is required for each entry. That is always the 1st tag in the entry that plays the role of entries separator.
Repeating groups are usually addressed by a leading tag.
To access fields inside a repeating group, it is required to get a field value specifying entry number. Entries are enumerated starting from 1.
Note: FixMessage
contains a convenient method Split(int repeatingGroupLeadingTagNumber)
that splits a repeating group and provides the list of FixMessage
for that repeating group.
The IFixSession.MessageValidator
property returns IMessageValidator
that could be used to
validate a message. It could be used to validate both message content:
IValidationResult ValidateContent(string msgType, FixMessage content);
and an entire FIX message:
IValidationResult Validate(FixMessage message);