/** * Send a message to the session specified by the provided session ID. * * @param message a FIX message * @param sessionID the target SessionID * @return true is send was successful, false otherwise * @throws SessionNotFound if session could not be located */ public static boolean sendToTarget(Message message, SessionID sessionID) throws SessionNotFound { final Session session = lookupSession(sessionID); if (session == null) { throw new SessionNotFound(); } message.setSessionID(sessionID); return session.send(message); }
/** * Send a message to the session specified by the provided session ID. * * @param message a FIX message * @param sessionID the target SessionID * @return true is send was successful, false otherwise * @throws SessionNotFound if session could not be located */ public static boolean sendToTarget(Message message, SessionID sessionID) throws SessionNotFound { final Session session = lookupSession(sessionID); if (session == null) { throw new SessionNotFound(); } message.setSessionID(sessionID); return session.send(message); }
/** * Send a message to the session specified by the provided session ID. * * @param message a FIX message * @param sessionID the target SessionID * @return true is send was successful, false otherwise * @throws SessionNotFound if session could not be located */ public static boolean sendToTarget(Message message, SessionID sessionID) throws SessionNotFound { final Session session = lookupSession(sessionID); if (session == null) { throw new SessionNotFound(); } message.setSessionID(sessionID); return session.send(message); }
/** * Send a message to the session specified in the message's target * identifiers. The session qualifier is used to distinguish sessions with * the same target identifiers. * * @param message a FIX message * @param qualifier a session qualifier * @return true is send was successful, false otherwise * @throws SessionNotFound if session could not be located */ public static boolean sendToTarget(Message message, String qualifier) throws SessionNotFound { try { final String senderCompID = getSenderCompIDFromMessage(message); final String targetCompID = getTargetCompIDFromMessage(message); return sendToTarget(message, senderCompID, targetCompID, qualifier); } catch (final FieldNotFound e) { throw new SessionNotFound("missing sender or target company ID"); } }
/** * Send a message to the session specified in the message's target * identifiers. The session qualifier is used to distinguish sessions with * the same target identifiers. * * @param message a FIX message * @param qualifier a session qualifier * @return true is send was successful, false otherwise * @throws SessionNotFound if session could not be located */ public static boolean sendToTarget(Message message, String qualifier) throws SessionNotFound { try { final String senderCompID = getSenderCompIDFromMessage(message); final String targetCompID = getTargetCompIDFromMessage(message); return sendToTarget(message, senderCompID, targetCompID, qualifier); } catch (final FieldNotFound e) { throw new SessionNotFound("missing sender or target company ID"); } }
/** * Send a message to the session specified in the message's target * identifiers. The session qualifier is used to distinguish sessions with * the same target identifiers. * * @param message a FIX message * @param qualifier a session qualifier * @return true is send was successful, false otherwise * @throws SessionNotFound if session could not be located */ public static boolean sendToTarget(Message message, String qualifier) throws SessionNotFound { try { final String senderCompID = message.getHeader().getString(SenderCompID.FIELD); final String targetCompID = message.getHeader().getString(TargetCompID.FIELD); return sendToTarget(message, senderCompID, targetCompID, qualifier); } catch (final FieldNotFound e) { throw new SessionNotFound("missing sender or target company ID"); } }
private void sendMessage(SessionID sessionID, Message message) { try { Session session = Session.lookupSession(sessionID); if (session == null) { throw new SessionNotFound(sessionID.toString()); } DataDictionaryProvider dataDictionaryProvider = session.getDataDictionaryProvider(); if (dataDictionaryProvider != null) { try { dataDictionaryProvider.getApplicationDataDictionary( getApplVerID(session, message)).validate(message, true); } catch (Exception e) { LogUtil.logThrowable(sessionID, "Outgoing message failed validation: " + e.getMessage(), e); return; } } session.send(message); } catch (SessionNotFound e) { log.error(e.getMessage(), e); } }