|
From: Andrew M. <mar...@gm...> - 2021-03-26 13:36:51
|
Hello everyone, Please excuse my ignorance regarding FIX programming. I know that when a FIX session is initiated a thread runs asynchronously, dispatching callbacks until the main application terminates. But I need a way to shutdown that thread as soon as I detect a particular error. My message handler which contains the callbacks has a state variable that can be queried by the main app. The main app has a polling loop rather than sleeping forever. That loop enables it to periodically check the state of the message handler. If it has got into a bad state then the main app shuts down. The trouble with this is that there is a window during which any number of FIX messages may be received. This is causing trouble. Those messages do not get replayed when the app is restarted because the remote FIX end thinks that because they were picked up they do not need to be replayed. I am able to jig things such that old messages can be seen again. I have a config parameter datetime for subscription. On restart I can set this back in time. There also the sequence numbers, another aspect controlled by configuration. While this worked fine during development it is no good for production. This is because any config change in production requires people to jump through hoops of fire. So I need to find a better way, that causes the FIX processing to cease as soon as the error is detected. Any ideas? Other than calling sys.exit(1) of course. That would be a bit like stopping your car by driving it straight into a brick wall, rather than taking your foot off the gas and applying the brake in the traditional way. :-) -- Regards, Andrew Marlow http://www.andrewpetermarlow.co.uk |