Your Fix handler/OMS/whatever communicates with SackFix in several ways. To start with you are responsible for initialising Akka and the gardian actor - the examples show this, in the example projects.
Both initiator and acceptor applications will have a session or sessions active and the critical actor you have to deal with is the SessionActor. I would advise you to create your own actor, and implement it as in the examples. There is a BusinessCommsHandler which you must pass into SackFix. Implement the handleFix message - all messages from SackFix are subclasses of the
SfBusinessFixInfo trait. This trait has a timestamp and also the sessionId associated with the connection - so you can get the compId’s etc.
As you can see, you are not forced to do your own actor - but I have above. The businessCommsHandler simply sends the message to your Actor. In the example above your business actor is called OMSMessageInActor. Note, if you cannot understand ! msg then read a little on Akka and you will understand this is simply sending a message to the actor.
The SfSessionId within the SfBusinessFixInfo tells you the following:
So at the very least you will have the beginString, senderCompId and targetCompId.
The events that can arrive from SackFix into your business object are:
You will note that all of these messages contain the sessionActor reference.
You can send message to the other side of the fix connection or ask the session
to logout by sending a message to the sessionActor.
So, Sackfix does all of the session times, creation, message store, replay and so on. You deal with the business layer, and send messages back as you want to.
How do I send a message?
The code to create a message and send it down to the session actor is as below. Simply initialise the fields that you want to use.
As you can see, SackFix uses strongly typed immutable fields and messages.