|
From: Colin D. <co...@ma...> - 2021-03-26 17:49:43
|
You can get the Session object with a SessionID: Session session = Session.lookupSession(sessionID) You're right: the doc does say this. We actually have an initiator for each session and we stop the initiator. On 3/26/21 10:38 AM, Andrew Marlow wrote: > QuickFIX/J Documentation: http://www.quickfixj.org/documentation/ > QuickFIX/J Support: http://www.quickfixj.org/support/ > > > > Hello, > > On Fri, 26 Mar 2021 at 13:54, Colin DuPlantis <co...@ma... > <mailto:co...@ma...>> wrote: > > QuickFIX/J Documentation: http://www.quickfixj.org/documentation/ > QuickFIX/J <http://www.quickfixj.org/documentation/QuickFIX/J> > Support: http://www.quickfixj.org/support/ > <http://www.quickfixj.org/support/> > [snip] > > As for stopping processing, we would just end the session with > Session.disconnect. Given that we restart the session where we > want it to start, compelling the counter to resend some messages, > we don't really worry about ending a session immediately. Use your > flag to determine whether you should process messages or not. That > way, the session can continue for a few seconds after you want it > to end and you'll just drop those messages, knowing you'll get > them back on restart. > > This approach doesn't require and config changes. On restart, the > system will automatically orient itself and restart where it's > supposed to. > > Indeed. That sounds good. Thank you for your quick response. > > I'd like to do this but without a Session object, I can't. The > disconnect method is not static so an object is required. Where would > I get one? In the callback where the error is detected I only have a > SessionId. Also the documentation for the disconnect method says you > should not use it. > > On 3/26/21 6:36 AM, Andrew Marlow wrote: >> QuickFIX/J Documentation:http://www.quickfixj.org/documentation/ <http://www.quickfixj.org/documentation/> >> QuickFIX/J Support:http://www.quickfixj.org/support/ <http://www.quickfixj.org/support/> >> >> >> >> 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 >> <http://www.andrewpetermarlow.co.uk> >> > > > > _______________________________________________ > Quickfixj-users mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfixj-users -- Colin DuPlantis Chief Architect, Marketcetera Download, Run, Trade 888.868.4884 https://www.marketcetera.com |