0

Can anyone tell me, in which circumstances quickfix.Session.sentToTarget(message, sessionId) returns false. Actually we i tried to send order to aceptor, it returns false, not throw any exception. Don't know why this happening every thing seems to be fine.

public void sendOrder(SessionID sessionId){
        ClOrdID order_id = new ClOrdID();
        order_id.setValue("121ifkaar");

        OrdType type = new OrdType(OrdType.LIMIT);

        OrderQty quantity = new OrderQty();
        quantity.setValue(new Double(79955));

        NewOrderSingle newOrderSingle = new NewOrderSingle(order_id, new Side(Side.SELL), new TransactTime(), type );
            newOrderSingle.set(new Account("ifkaar123"));
            newOrderSingle.set(new Symbol("USD"));
            newOrderSingle.set(new Currency("United State Doller"));
            Message msg =  (Message)newOrderSingle;
            try{
            boolean result = Session.sendToTarget(msg, sessionId);
            if(result){
                System.out.println("Message Send:   "+result);
            }else{
                System.out.println("Message Not send:   "+result);
            }
            }catch(Exception e){e.printStackTrace();}
    }
Muneeb Nasir
  • 2,414
  • 4
  • 31
  • 54
  • Aug 7, 2012 4:25:05 PM quickfix.mina.initiator.InitiatorIoHandler sessionCreated INFO: MINA session created for FIX.4.4:->:FXallTrade: local=/127.0.0.1:37670, class org.apache.mina.transport.socket.nio.SocketSessionImpl, remote=/127.0.0.1:3000 Aug 7, 2012 4:25:05 PM quickfix.mina.initiator.InitiatorIoHandler sessionCreated INFO: MINA session created for FIX.4.4:->:FXallStream: local=/127.0.0.1:37671, class org.apache.mina.transport.socket.nio.SocketSessionImpl, remote=/127.0.0.1:3000 Message Not send: false – Muneeb Nasir Aug 07 '12 at 11:49
  • no i do not find answer yet. I you have solution than please share with me. – Muneeb Nasir Aug 11 '12 at 08:14
  • As written before, when you start your application, the HeartBeat messages flow in both directions? – stexcec Aug 13 '12 at 09:19
  • yeah its working. Connection was not establishing. Now it's working.. – Muneeb Nasir Aug 15 '12 at 07:04
  • Now it's working but..what have you modified? – stexcec Aug 16 '12 at 10:25
  • there was problem in .cfg file, I was using wrong targetCompId, that's why connection was not establishing b/w initiator and acceptor. – Muneeb Nasir Aug 27 '12 at 05:52

1 Answers1

0

First of all, when you start your Initiator, you will see the HeartBeat messgages (tag 35=0) flowing from and to the counterparty?

stexcec
  • 1,143
  • 1
  • 18
  • 34