0

谁能告诉我,在什么情况下 quickfix.Session.sentToTarget(message, sessionId) 返回 false。实际上,我们尝试向接收器发送订单,它返回 false,没有抛出任何异常。不知道为什么会发生这种情况,每件事似乎都很好。

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();}
    }
4

1 回答 1

0

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

于 2012-08-07T12:46:16.200 回答