{{Quickfixn}} Session management improvement

Nazar Mandzyk nmandzyk at hotmail.com
Mon May 8 08:45:08 PDT 2023


Hello Team,
I would like to start contributing QuickFix/n and based on the current usage of QuickFix/n I would like to discuss a small enhancement for weekly session lifetime management here is how code changes look like https://github.com/connamara/quickfixn/pull/769 .

Now, let me please describe what I am trying to improve. In most cases, the session should be active for business hours during the week and the FIX configuration for this will look like this:

[DEFAULT]
TimeZone=America/New_York
FileLogPath=ecn_log
FileStorePath=ecn_store
UseDataDictionary=Y
DataDictionary=./Config/FIX44.xml
ReconnectInterval=30
LogoutTimeout=5
ResetOnLogout=Y
ResetOnDisconnect=N
SSLEnable=N
HeartBtInt=60
BeginString=FIX.4.4
ConnectionType=initiator
SocketConnectHost=localhost
SocketConnectPort=5555
SenderCompID=TestSendComp
TargetCompID=TestTargComp

[SESSION]
SessionQualifier=monday
StartTime=06:00:00
EndTime=17:00:00
StartDay=monday
EndDay=monday

[SESSION]
SessionQualifier=tuesday
StartTime=06:00:00
EndTime=17:00:00
StartDay=tuesday
EndDay=tuesday

[SESSION]
SessionQualifier=wednesday
StartTime=06:00:00
EndTime=17:00:00
StartDay=wednesday
EndDay=wednesday

[SESSION]
SessionQualifier=thursday
StartTime=06:00:00
EndTime=17:00:00
StartDay=thursday
EndDay=thursday

[SESSION]
SessionQualifier=friday
StartTime=06:00:00
EndTime=17:00:00
StartDay=friday
EndDay=friday


If we just specify the time range without days range, session will be active for the weekends and as result logs will be spammed with messages like these:

[18:25:48 INF] FIX.4.4:TestSendComp->TestTargComp:monday - QuickFix Event: Connecting to 127.0.0.1 on port 5555
[18:25:50 INF] FIX.4.4:TestSendComp->TestTargComp:monday - QuickFix Event: Connection failed: No connection could be made because the target machine actively refused it. 127.0.0.1:5555
[18:26:18 INF] FIX.4.4:TestSendComp->TestTargComp:monday - QuickFix Event: Connecting to 127.0.0.1 on port 5555
[18:26:20 INF] FIX.4.4:TestSendComp->TestTargComp:monday - QuickFix Event: Connection failed: No connection could be made because the target machine actively refused it. 127.0.0.1:5555
[18:26:49 INF] FIX.4.4:TestSendComp->TestTargComp:monday - QuickFix Event: Connecting to 127.0.0.1 on port 5555
[18:26:51 INF] FIX.4.4:TestSendComp->TestTargComp:monday - QuickFix Event: Connection failed: No connection could be made because the target machine actively refused it. 127.0.0.1:5555

If we specify the days range, the session will activate after business hours and again we will see logs as above during the night. To avoid logs spamming I purpose adding one more configuration setting "UseDailyTimeCheck", that will stop the session after business hours it it's turned on. So, original configuration for weekly session will look like this :

[DEFAULT]
TimeZone=America/New_York
FileLogPath=ecn_log
FileStorePath=ecn_store
UseDataDictionary=Y
DataDictionary=./Config/FIX44.xml
ReconnectInterval=30
LogoutTimeout=5
ResetOnLogout=Y
ResetOnDisconnect=N
SSLEnable=N
HeartBtInt=60
BeginString=FIX.4.4
ConnectionType=initiator
SocketConnectHost=localhost
SocketConnectPort=5555
SenderCompID=TestSendComp
TargetCompID=TestTargComp
UseDailyTimeCheck=Y

[SESSION]
StartTime=06:00:00
EndTime=17:00:00
StartDay=monday
EndDay=friday

So, we can see above we just specify one session without "SessionQualifier" that runs during the whole week only for business hours, it will make logs clear, and the initiator will try to connect only when it will need.
Please, let me know what you think about this improvement.

Thanks,
Nazar


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.quickfixn.com/pipermail/quickfixn-quickfixn.com/attachments/20230508/6b4cf2e8/attachment-0001.htm>


More information about the Quickfixn mailing list