简体   繁体   English

Quickfix在启动时重置序列号,但未在登录消息中设置ResetSeqNum

[英]Quickfix reset sequence number at start time but not set ResetSeqNum in Logon message

When the quickfix initiator reconnects at startTime (defined in config) it deletes the files with sequence number, but does not set ResetSeqNumFlag to Y , and the server replies with a Logout message with text "seq msg number to low ..." Is there a way to set ResetSeqNumFlag = Y only for this behavior? 当quickfix发起程序在startTime重新连接(在config中定义)时,它会删除序列号的文件,但不会将ResetSeqNumFlag设置为Y ,服务器将回复带有文本“seq msg number to low ...”的Logout消息。是否存在一种只为此行为设置ResetSeqNumFlag = Y方法? I don`t want to reset the sequence on every log-on. 我不想在每次登录时重置序列。

This appears to be a QuickFIX/J quirk (some might consider it a bug). 这似乎是一个QuickFIX / J怪癖(有些人可能认为它是一个bug)。 If ResetOnLogon=N then no ResetSeqNumFlag=Y is sent when the session start time triggers a logon. 如果ResetOnLogon = N,则在会话开始时间触发登录时不会发送ResetSeqNumFlag = Y. If ResetOnLogon=Y, the ResetSeqNumFlag=Y is sent on every logon. 如果ResetOnLogon = Y,则每次登录时都会发送ResetSeqNumFlag = Y. I believe this is not a big problem in practice because participants in a FIX session typically reset their sequence numbers locally after a session ends (logically ends at the end time, not a connection disconnect). 我认为这在实践中不是一个大问题,因为FIX会话中的参与者通常在会话结束后在本地重置其序列号(逻辑上在结束时间结束,而不是连接断开)。

If you want to slightly modify the source code to implement this behavior, you'd modify the quickfix.Session next() method. 如果要稍微修改源代码以实现此行为,则需要修改quickfix.Session next()方法。 You could add a local flag that indicates a session has restarted (per the schedule as determined by checkSessionTime()). 您可以添加一个本地标志,指示会话已重新启动(根据checkSessionTime()确定的计划)。 Pass that flag to generateLogon() and that method would use it to determine when to send ResetSeqNumFlag=Y regardless of the ResetOnLogon configuration. 将该标志传递给generateLogon(),该方法将使用它来确定何时发送ResetSeqNumFlag = Y,而不管ResetOnLogon配置如何。

I don`t want to reset the sequence on every log-on. 我不想在每次登录时重置序列。

Then don't do it! 然后不要这样做! Set ResetOnLogon=N . 设置ResetOnLogon=N

At StartTime, the session will reset sequence numbers always. 在StartTime,会话将始终重置序列号。 If ResetOnLogon=N , then they won't reset again until the next StartTime. 如果ResetOnLogon=N ,则在下一个StartTime之前它们不会再次复位。

The initiator and acceptor should always have matching ResetOnXXX settings. ResetOnXXX者和接受者应始终具有匹配的ResetOnXXX设置。

What you are asking cannot, should not be done. 你不能做什么,不应该做。 You start you engine with some config and then you change the config while running. 您使用某个配置启动引擎,然后在运行时更改配置。 If something goes wrong it will be very difficult to pinpoint what started the issue. 如果出现问题,将很难确定问题的原因。

Instead of doing ResetSeqNumFlag = Y try adding ResetOnLogon=Y in your config for the acceptor side(that is if you have control over it) or ResetOnLogout=Y / ResetOnDisconnect=Y in your initiator config file. 而不是执行ResetSeqNumFlag = Y尝试在您的配置中为接收方添加ResetOnLogon=Y (即,如果您可以控制它)或在启动器配置文件ResetOnLogout=Y / ResetOnDisconnect=Y That would be much easier and changing config while running, is possibly not the best solution. 这会更容易,并且在运行时更改配置,可能不是最佳解决方案。

Your logout(disconnect can happen anytime) will happen anyways at EndTime anyways and should be easier for your application. 无论如何,您的注销(无论何时都可以断开连接)都会在EndTime发生,应该更容易为您的应用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM