Search in sources :

Example 26 with SessionID

use of quickfix.SessionID in project camel by apache.

the class QuickfixjMessageJsonTransformer method transform.

public String transform(Message message) throws FieldNotFound, ConfigError {
    SessionID sessionID = MessageUtils.getSessionID(message);
    Session session = Session.lookupSession(sessionID);
    DataDictionary dataDictionary = session.getDataDictionary();
    if (dataDictionary == null) {
        throw new IllegalStateException("No Data Dictionary. Exchange must reference an existing session");
    }
    return transform(message, dataDictionary);
}
Also used : DataDictionary(quickfix.DataDictionary) SessionID(quickfix.SessionID) Session(quickfix.Session)

Example 27 with SessionID

use of quickfix.SessionID in project camel by apache.

the class FixMessageRouter method route.

public String route(Exchange exchange) {
    Message message = exchange.getIn().getBody(Message.class);
    if (message != null) {
        SessionID destinationSession = getDestinationSessionID(message);
        if (destinationSession != null) {
            String destinationUri = String.format("%s?sessionID=%s", engineUri, destinationSession);
            LOG.debug("Routing destination: {}", destinationUri);
            return destinationUri;
        }
    }
    return null;
}
Also used : Message(quickfix.Message) BeginString(quickfix.field.BeginString) SessionID(quickfix.SessionID)

Aggregations

SessionID (quickfix.SessionID)27 Test (org.junit.Test)13 Message (quickfix.Message)13 Session (quickfix.Session)7 Exchange (org.apache.camel.Exchange)6 SessionSettings (quickfix.SessionSettings)6 DefaultExchange (org.apache.camel.impl.DefaultExchange)5 CountDownLatch (java.util.concurrent.CountDownLatch)4 DataDictionary (quickfix.DataDictionary)4 ArrayList (java.util.ArrayList)3 NoHops (quickfix.fix44.Message.Header.NoHops)3 IOException (java.io.IOException)2 URL (java.net.URL)2 URLClassLoader (java.net.URLClassLoader)2 Properties (java.util.Properties)2 Before (org.junit.Before)2 BeginString (quickfix.field.BeginString)2 Email (quickfix.fix42.Email)2 MalformedURLException (java.net.MalformedURLException)1 Date (java.util.Date)1