quickfixj

QuickFIX/J - how to stop Initiator automatic logon


We have implemented initiator , web bases where user login by entering the session ID details like beginstring, compid,targetcompid. Now, we are facing scenario where, first time, due to some reason,it got disconnecting message. But after some time, it will automatically logon. And appear suddenly as connected in users table. So how can we stop that ? We want that, once he got disconnected message ,for him it should be disconnected only until he enters the details again ?


Solution

  • To prevent automatic logon of Initiator you could use one of these ways:

    1. Call logout() on the session. This will set the session to disabled which will prevent reconnection. If it is OK to relogin, call logon().
    2. Implement ApplicationExtended.canLogon() and return false. If it is OK to relogin, return true.