use of quickfix.SessionNotFound in project camel by apache.
the class TradeExecutor method sendMessage.
private void sendMessage(SessionID sessionID, Message message) {
try {
Session session = Session.lookupSession(sessionID);
if (session == null) {
throw new SessionNotFound(sessionID.toString());
}
DataDictionaryProvider provider = session.getDataDictionaryProvider();
if (provider != null) {
try {
ApplVerID applVerID = getApplVerID(session, message);
DataDictionary appDataDictionary = provider.getApplicationDataDictionary(applVerID);
appDataDictionary.validate(message, true);
} catch (Exception e) {
LogUtil.logThrowable(sessionID, "Outgoing message failed validation: " + e.getMessage(), e);
return;
}
}
for (QuickfixjMessageListener listener : listeners) {
try {
listener.onMessage(sessionID, message);
} catch (Throwable e) {
LogUtil.logThrowable(sessionID, "Error while dispatching message", e);
}
}
} catch (SessionNotFound e) {
LOG.error(e.getMessage(), e);
}
}
Aggregations