Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

 In order to save session state into the database, BL-Rules should be configured on the FIXEdge side:

...

 In order to save session state into the history file, BL-Rules should be configured on the FIXEdge side:

...

BL_Config.xml
<?xml version="1.0" encoding="UTF-8"?>
<!--
<!DOCTYPE FIXEdge SYSTEM "BusinessLayer.dtd">
-->
<FIXEdge>
 <BusinessLayer>
  <!-- File history with Session Status -->
  <History
  Name="SessionStatus"
  StorageType="File"
  WorkingDirectory="FIXEdge1/conf/"
  StorageFileName="SessionStatus">
  <KeyFields>49, 56, 42, 147</KeyFields>
 </History>
 
  <!-- Save Events in 35=C messages notifing about session state to the file -->
  <Rule>
   <Source>
    <FixSession SenderCompID=".*" TargetCompID=".*" />
   </Source>
   <Condition>
    <MatchField Field="35" Value="C"/>
    <MatchField Field="147" Value=".*:.*"/> <!-- Assume sender and target in 147 field is divided by ':'. The rest of the messages are redundant -->
    <Exclusion>
     <MatchMessage Value=".*147=.* AttemptToConnect.*"/>
    </Exclusion>
   </Condition>
   <Action>
   <Script Language="JavaScript" FileName="FIXEdge1/conf/prepareSessionState.js"/>
    <SaveToHistory Name="SessionStatus"/>
   </Action>
  </Rule>
 
  <DefaultRule>
   <Action>
    <DoNothing/>
   </Action>
  </DefaultRule>
 </BusinessLayer>
</FIXEdge>

 As a result, FIXEdge creates history file with session statuses:

...

SessionStatus.history
 

...

<Record valid='Y' size='/' data='SENDER1 TARGET1 20160920-13:41:32 Established'/>

<Record valid='Y' size='/' data='SENDER2 TARGET2 20160920-13:41:32 Established'/>

<Record valid='Y' size='8' data='SENDER1 TARGET1 20160920-21:00:01 Terminated correctly'/>

<Record valid='Y' size='8' data='SENDER2 TARGET2 20160920-21:00:01 Terminated correctly'/>