-1

I am a newbie to use quickfixj. I'm trying to prepare a client to receive message connecting with an IP and port. After reading QFJ documentation/support, I can't get any idea. Is there a perfect way to receive message from the server using quick fix/J? The below class implemented with Connector interface.

SocketInitiator socketInitiator = new SocketInitiator(application,
                fileStoreFactory, sessionSettings, logFactory,
                messageFactory);
SessionID sessionId = socketInitiator.getSessions().get(0);

socketInitiator.start();    
@Override
public void start() throws ConfigError, RuntimeError{
Logon logon = new Logon();
    Header header = logon.getHeader();
    header.setField(new BeginString("FIX.4.2"));        //   "FIXT.1.1"
    logon.setField(new SenderSubID("pro"));
    logon.setField(new RawData("pro"));
    logon.setField(new SenderCompID("pro"));
    logon.setField(new TargetCompID("TRAD"));
    logon.set(new HeartBtInt(30));
    logon.set(new ResetSeqNumFlag(true));
    boolean sent = Session.sendToTarget(logon, sessionId);
    System.out.println("Logon Message Sent : " + sent);
 }
randxy
  • 103
  • 1
  • 4
  • 19

1 Answers1

1

The code that you've provided is not the recommended way of using QuickFIX/j.

I don't know why you'd override start(), and you certainly should not be creating and explicitly sending Logon messages (or any other kind of admin message). If you create and configure your app in the recommended way, the engine will automagically create and send the Logon message for you.

Before proceeding further, you really need to look at the QF/j example applications and review the manual.

Grant Birchmeier
  • 17,809
  • 11
  • 63
  • 98