|
From: Toli K. <to...@ma...> - 2007-04-26 15:46:29
|
Robert, > 1.) We plan on connecting to 4 end-points, so I have 4 sessions in my > configuration file...is there a benefit to using the > ThreadedSocketInitiator as opposed to just the SocketInitiator? This is a classic trade-off. if you need all your incoming messages to be processed in order they are coming in across all connections, then use the regular SocketInitiator. If the 4 connections are totally unrelated then you can process them concurrently using the ThreadedSocketInitiator > > 2.) If one of our end-point's connection goes down indefinitely, are > the remaining 3 sessions ok? Say one of the 4 end-points goes down > momentarily and then goes back up, will the engine reconnect or do I > have to bring the entire engine down and reconnect all 4 sessions? QFJ should reconnect to the lost connection when it comes back u and renegotiate a logon. there area various timeout settings you can tweak to modify the timeout behaviour. > 3.) Examples of the custom Initiator classes have a 'System.in' > statement waiting for a user to hit a key on the keyboard to exit the > engine. If we want to put this process in the background, this isn't a > feasible design obviously...so I was curious what people are doing to > build an engine that can be set as a background process and then when > brought back to the foreground, how is the engine being stopped > elegantly so the appropriate logout and disconnect procedures occur? > I'd be intersted to hear how others approach this problem as well. For now, we create the socket initiator and FIX listenrers in Spring, and then the main thread just goes to sleep (we do a new Semaphore(0).wait()). The OMS is then killed by pressing Ctrl-C if you run it on the console, or with an /etc/init.d script wrapping a 'kill -9' on our virtual appliance. Here's the code for reference: http://trac.marketcetera.org/trac.fcgi/browser/platform/trunk/oms/src/main/java/org/marketcetera/oms/OrderManagementSystem.java#L59 -- Toli Kuznets http://www.marketcetera.com: Open-Source Trading Platform download.run.trade. |