3

I am using quickfixj where I have acceptor from which I am sending fix message using Logout() method "8=FIX.4.29=8235=534=38749=TEST152=20130409-08:01:47.86256=TEST2-1136558=User Is Blocked10=231" to initiator , but I can see heart beat sent from Acceptor itself how do we over come this ? I am using the below code

        Logout oLogout = new Logout();
        quickfix.field.Text aText = new quickfix.field.Text("User Is Blocked");
        oLogout.set(aText);
        Session.sendToTarget(oLogout, "TEST2-11365, "TEST1");
Arvind
  • 41
  • 3

1 Answers1

3

You should not manually send a Logout like this. Logout is an admin message; you should trust the engine to send/receive all admin message types.

What is happening is that you are sending this message outside of the engine's control logic. The engine is treating it as any other outgoing application-level message, and not initiating the engine's internal shutdown logic.

If you call Acceptor.stop(), then engine will initiate its shutdown logic and send the Logout for you.

Grant Birchmeier
  • 17,809
  • 11
  • 63
  • 98
  • 1
    I am pretty sure when you use sendToTarget it sends it as an application message (through toApp) and not an admin message (through toAdmin) – robthewolf Apr 09 '13 at 15:40
  • Yes, that is correct. I was trying to get at that in my answer. I just added a bit to improve that, thanks. – Grant Birchmeier Apr 09 '13 at 15:43
  • Hi First of all thanks a lot for the quick reply . @Grant Birchmeier if it considers it as another message then how to go about it , I have multiple session need to validate incoming connections reject invalid session and then terminate session how do we go about it ? – Arvind Apr 10 '13 at 05:05
  • @robthewolf yes have been using sendToTarget to send messages . – Arvind Apr 10 '13 at 05:09
  • Invalid connections will be rejected by the underlying quickfix engine itself, you do not need to add any special validation logic for it. The quickfix engine will use your specified config to do the validation. – Rush Apr 10 '13 at 13:40
  • Rush is right. Your acceptor will automatically reject all initiators that don't match sessions defined in your config file. You should not be doing disconnections in the QF callbacks. – Grant Birchmeier Apr 10 '13 at 15:18