/** * Send a message to the session specified in the message's target * identifiers. * * @param message a FIX message * @return true is send was successful, false otherwise * @throws SessionNotFound if session could not be located */ public static boolean sendToTarget(Message message) throws SessionNotFound { return sendToTarget(message, ""); }
/** * Helper method to be overridden by tests that handles sending out the message. */ protected void doSend(Message message, SessionID sessionID) throws SessionNotFound { Session.sendToTarget(message, sessionID); }
/** * Send a message to the session specified in the message's target * identifiers. * * @param message a FIX message * @return true is send was successful, false otherwise * @throws SessionNotFound if session could not be located */ public static boolean sendToTarget(Message message) throws SessionNotFound { return sendToTarget(message, ""); }
public boolean sendToTarget(Message message, String senderCompID, String targetCompID, String qualifier) throws SessionNotFound { return Session.sendToTarget(message, senderCompID, targetCompID, qualifier); } }
/** * Helper method to be overridden by tests that handles sending out the message. */ protected void doSend(Message message, SessionID sessionID) throws SessionNotFound { Session.sendToTarget(message, sessionID); }
/** * Helper method to be overridden by tests that handles sending out the message. */ protected void doSend(Message message, SessionID sessionID) throws SessionNotFound { Session.sendToTarget(message, sessionID); }
/** * Send a message to the session specified by the provided target company * ID. The sender company ID is provided as an argument rather than from the * message. * * @param message a FIX message * @param senderCompID the sender's company ID * @param targetCompID the target's company ID * @return true is send was successful, false otherwise * @throws SessionNotFound if session could not be located */ public static boolean sendToTarget(Message message, String senderCompID, String targetCompID) throws SessionNotFound { return sendToTarget(message, senderCompID, targetCompID, ""); }
/** To be overridden by unit tests for capturing outgoing messages */ public void sendOutgoingMessage(Message inMsg, SessionID targetID) throws SessionNotFound { Session.sendToTarget(inMsg, targetID); }
/** * Send a message to the session specified in the message's target * identifiers. * * @param message a FIX message * @return true is send was successful, false otherwise * @throws SessionNotFound if session could not be located */ public static boolean sendToTarget(Message message) throws SessionNotFound { return sendToTarget(message, ""); }
public boolean sendToTarget(Message message, String qualifier) throws SessionNotFound { return Session.sendToTarget(message, qualifier); }
public boolean sendToTarget(Message message, SessionID sessionID) throws SessionNotFound { return Session.sendToTarget(message, sessionID); }
public boolean sendToTarget(Message message, String senderCompID, String targetCompID) throws SessionNotFound { return Session.sendToTarget(message, senderCompID, targetCompID); }
public boolean sendToTarget(Message message) throws SessionNotFound { return Session.sendToTarget(message); }
/** * Send a message to the session specified by the provided target company * ID. The sender company ID is provided as an argument rather than from the * message. * * @param message a FIX message * @param senderCompID the sender's company ID * @param targetCompID the target's company ID * @return true is send was successful, false otherwise * @throws SessionNotFound if session could not be located */ public static boolean sendToTarget(Message message, String senderCompID, String targetCompID) throws SessionNotFound { return sendToTarget(message, senderCompID, targetCompID, ""); }
private void send(quickfix.Message message, SessionID sessionID) { try { Session.sendToTarget(message, sessionID); } catch (SessionNotFound e) { System.out.println(e); } }
@Override protected void sendQuotes(List<Quote> buffer) { buffer.forEach(quote -> { for (Map.Entry<String, SessionID> subscriptionEntry : subscriptions.entrySet()) { try { Message quoteMessage = createQuoteMessage(subscriptionEntry.getKey(), quote); Session.sendToTarget(quoteMessage, subscriptionEntry.getValue()); } catch (SessionNotFound e) { LOGGER.error("Can't send message", e); } } }); } }
private boolean sendToTarget(ExecutionReport report, SessionID sessionID) { try { return Session.sendToTarget(report, sessionID); } catch (SessionNotFound sessionNotFound) { throw new RuntimeError(sessionNotFound); } }
private void sendSessionReject(Message message, int rejectReason) throws FieldNotFound, SessionNotFound { Message reply = createMessage(message, MsgType.REJECT); reverseRoute(message, reply); String refSeqNum = message.getHeader().getString(MsgSeqNum.FIELD); reply.setString(RefSeqNum.FIELD, refSeqNum); reply.setString(RefMsgType.FIELD, message.getHeader().getString(MsgType.FIELD)); reply.setInt(SessionRejectReason.FIELD, rejectReason); Session.sendToTarget(reply); }
private void sendBusinessReject(Message message, int rejectReason, String rejectText) throws FieldNotFound, SessionNotFound { Message reply = createMessage(message, MsgType.BUSINESS_MESSAGE_REJECT); reverseRoute(message, reply); String refSeqNum = message.getHeader().getString(MsgSeqNum.FIELD); reply.setString(RefSeqNum.FIELD, refSeqNum); reply.setString(RefMsgType.FIELD, message.getHeader().getString(MsgType.FIELD)); reply.setInt(BusinessRejectReason.FIELD, rejectReason); reply.setString(Text.FIELD, rejectText); Session.sendToTarget(reply); }
private void rejectOrder(String senderCompId, String targetCompId, String clOrdId, String symbol, char side, String message) { ExecutionReport fixOrder = new ExecutionReport(new OrderID(clOrdId), new ExecID(generator .genExecutionID()), new ExecTransType(ExecTransType.NEW), new ExecType( ExecType.REJECTED), new OrdStatus(ExecType.REJECTED), new Symbol(symbol), new Side( side), new LeavesQty(0), new CumQty(0), new AvgPx(0)); fixOrder.setString(ClOrdID.FIELD, clOrdId); fixOrder.setString(Text.FIELD, message); fixOrder.setInt(OrdRejReason.FIELD, OrdRejReason.BROKER_EXCHANGE_OPTION); try { Session.sendToTarget(fixOrder, senderCompId, targetCompId); } catch (SessionNotFound e) { e.printStackTrace(); } }