Re: [Quickfix-developers] Network disconnect recovery testing
Brought to you by:
orenmnero
From: Mike G. <mg...@co...> - 2017-04-13 15:26:42
|
Dermot, Have you set PersistMessages=N in your SessionSettings? This is one way to prevent resend (i.e. cause GapFill over App-level msgs). Another way is to throw DoNotSend in toApp for possdup msgs: *void App::toApp(FIX::Message& msg, const FIX::SessionID&) throw(FIX::DoNotSend)* *{* * try * * {* * FIX::PossDupFlag possDupFlag;* *msg**.getHeader().getField(possDupFlag);* * if (possDupFlag)* * throw FIX::DoNotSend();* * }* * catch (FIX::FieldNotFound&)* * { }* *}* As you say, this is almost certainly the behavior you want for sending orders, and that's the two main ways to achieve it. If you are not doing either of those things, QF will indeed resend instead of sending GapFills. If you want to detect a connection problem, you can use onLogon() and onLogout() to alert or set some state. You can think of onLogout() as "onDisconnect" as well -- it will get called even if you didn't get a clean Logout. Another way to do it on the fly is: *FIX::Session * pSession = FIX::Session::lookupSession(sessionID);* *if (pSession->isLoggedOn()) { /* ... */ }* -- Mike Gatny Connamara Systems, LLC On Thu, Apr 13, 2017 at 10:37 AM, <daw...@ya...> wrote: > Hi Guys, I've been doing some recovery testing and I have a couple of > questions. > > Firstly, my setup is pretty simple - my trading application (initiator) > and sell-side simulator (acceptor) are set up on two different networked > machines, both are quickfix apps. Here's what I'm doing:- > > 1. Establish a connection between initiator and acceptor. > 2. Send some orders and ack them on the acceptor side. > 2. Break the network connection on the initiator side. > 3. Send some more orders from the initiator. > 4. Fill existing orders on acceptor side. > 5. Reconnect the initiator to the network. > > At this point quickfix handles the reconnect and all the executions flow > back to the initiator. However the new orders I sent from the initiator > during the downtime are not resent to the executor [they are gap filled > instead]. Is this the correct behaviour? Actually this is exactly the > behaviour I want but I thought quickfix would resend them. So that's my > first question. > > My second question is what is the best way to determine a connection > problem before sending any order? > > Thanks! > Dermot > |