...
For each change of session state, FIXEdge creates a new internal FIX message (35=C | 49=fake | 56=fake ) and sends this message into the business layer to notify about the changes.
...
- parse tag 147 using JavaScript;
save session state to history.
Message parsing
In order to get a session state, it is recommended to use the script below. It allows to parse allows parsing tag 147 in the 35=C message which contains the session name and actual session state.
...
In order to save session state to the database it is required to perform the following steps::
- Create a corresponding table to store session statuses;
Create a stored procedure which that allows to write writing data into the table.
Please find an example below. In this case, the PostgreSQL database is used.
...
FIXEdge configuration
In order to save the session state into the database, BL-Rules should be configured on the FIXEdge side:
- Rule The rule for history definition: history name, database parameters, fields definitions.
- Rule The rule for saving to history: get the message 35 = C, get the session status using JavaScript, save to history (database).
BL_Config.xml |
---|
<?xml version="1.0" encoding="UTF-8"?> <!-- DB Table with Session Status --> <!-- Save Events in 35=C messages notifing about session state to DB --> <Exclusion> <DefaultRule> </BusinessLayer> |
Info |
---|
The tag (42) OrigTime is saved as a string. If it is needed to save it as Datetime type it is required to convert it to the specific format via JavaScript. E.g. from 'YYYYMMDD-hh:mm:ss' to 'YYYYMMDD hh:mm:ss':
|
File history
FIXEdge configuration
In order to save the session state into the history file, BL-Rules should be configured on the FIXEdge side:
- Rule The rule for history definition: history name, history file parameters, fields definitions.
- Rule The rule for saving to history: get message 35 = C, get session status using JavaScript, save to history (file).
...
As a result, FIXEdge creates a history file with session statuses:
...