how to replay a quickfix log

蓝咒 提交于 2019-12-20 02:59:11

问题


I do see that this has been asked before, but I see no answer as yet. Is there a way to replay a quickfix log file? My app initiated the session, receives data, quickfix logs the data, my app crashes. When I restart I want to simple replay everything in the log file. Can that be done?

Or if not, does anyone have an example of how to programatically request a resend of all session messages or of resetting the receive seq# to 1? Any help would be appreciated.


回答1:


No, not really.

FIX is a two-way communication protocol. You can't just "replay" one side; that doesn't really make sense.

That's like saying you want Alice to restart a conversation with Bob, but Alice must read her lines from a transcript of what she said before. You have no guarantee that Bob will say what he said before, and Bob might just be confused.

Now, if you're talking about some kind of test tool, where one side is "playing" data that is predetermined... well, you should be more specific in your question. That said, QuickFIX provides no feature for doing such a thing, and doesn't really lend itself to doing that. You'd be better off writing a standalone tool that writes those messages to a raw socket. (My firm has actually written such a test tool.)

Regarding sequence numbers, check the "ResetOn<XXX>" configuration settings. You probably want ResetOnLogon or the like. (Make sure your initiator's seq# policy is the same as your counterparty's, or you will have problems.)

If you think you have to programmatically reset your sequence number, you are probably doing something wrong. Four years on the QF mailing lists have taught me this. I've never seen anyone legitimately need to do this.




回答2:


Make sure your settings in the config file are set not to reset on logon. The when you reconnect after a crash you will automatically do a resend of all the message that were missed.



来源:https://stackoverflow.com/questions/13160132/how-to-replay-a-quickfix-log

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!