Package quickfix

Examples of quickfix.SessionID


    @Test
    public void convertSessionID() {
        Object value = camelContext.getTypeConverter().convertTo(SessionID.class, "FIX.4.0:FOO->BAR");
       
        assertThat(value, instanceOf(SessionID.class));
        assertThat((SessionID)value, is(new SessionID("FIX.4.0", "FOO", "BAR")));
    }
View Full Code Here


        assertThat((SessionID)value, is(new SessionID("FIX.4.0", "FOO", "BAR")));
    }

    @Test
    public void convertToExchange() {
        SessionID sessionID = new SessionID("FIX.4.0", "FOO", "BAR");
        QuickfixjEndpoint endpoint = new QuickfixjEndpoint(null, "", camelContext);
       
        Message message = new Message();    
        message.getHeader().setString(MsgType.FIELD, MsgType.ORDER_SINGLE);
       
View Full Code Here

        assertThat((String)exchange.getIn().getHeader(QuickfixjEndpoint.MESSAGE_TYPE_KEY), is(MsgType.ORDER_SINGLE));
    }

    @Test
    public void convertToExchangeWithNullMessage() {
        SessionID sessionID = new SessionID("FIX.4.0", "FOO", "BAR");
        QuickfixjEndpoint endpoint = new QuickfixjEndpoint(null, "", camelContext);
       
        Exchange exchange = QuickfixjConverters.toExchange(endpoint, sessionID, null, QuickfixjEventCategory.AppMessageSent);
       
        assertThat((SessionID)exchange.getIn().getHeader(QuickfixjEndpoint.SESSION_ID_KEY), is(sessionID));
View Full Code Here

        assertThat(value, instanceOf(Message.class));
    }

    @Test
    public void convertMessageWithRepeatingGroupsUsingSessionID() throws Exception {
        SessionID sessionID = new SessionID("FIX.4.4", "FOO", "BAR");
       
        createSession(sessionID);
       
        try {
            String data = "8=FIX.4.4\0019=40\00135=A\001"
View Full Code Here

        }
    }

    @Test
    public void convertMessageWithRepeatingGroupsUsingExchangeDictionary() throws Exception {
        SessionID sessionID = new SessionID("FIX.4.4", "FOO", "BAR");
       
        createSession(sessionID);
       
        try {
            String data = "8=FIX.4.4\0019=40\00135=A\001"
View Full Code Here

        }
    }

    @Test
    public void convertMessageWithRepeatingGroupsUsingExchangeDictionaryResource() throws Exception {
        SessionID sessionID = new SessionID("FIX.4.4", "FOO", "BAR");
       
        createSession(sessionID);
       
        try {
            String data = "8=FIX.4.4\0019=40\00135=A\001"
View Full Code Here

            
            // Look for a reply execution report back to the requester session
            // and having the requested OrderID. This is a loose correlation but the best
            // we can do with FIX 4.2. Newer versions of FIX have an optional explicit correlation field.
            exchange.setProperty(QuickfixjProducer.CORRELATION_CRITERIA_KEY, new MessagePredicate(
                new SessionID(sessionID), MsgType.EXECUTION_REPORT).withField(OrderID.FIELD, request.getString(OrderID.FIELD)));
           
            exchange.getIn().setBody(request);
        }
View Full Code Here

    public QuickfixjEventJsonTransformer() throws ConfigError {
        renderer = new QuickfixjMessageJsonTransformer();
    }
   
    public String transform(Exchange exchange) {
        SessionID sessionID = (SessionID) exchange.getIn().getHeader(QuickfixjEndpoint.SESSION_ID_KEY);
        Session session = Session.lookupSession(sessionID);
        DataDictionary dataDictionary = session.getDataDictionary();
       
        if (dataDictionary == null) {
            throw new IllegalStateException("No Data Dictionary. Exchange must reference an existing session");
View Full Code Here

    }
   
    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;
            }
View Full Code Here

            }
            if (header.isSetField(SenderLocationID.FIELD)) {
                header.setString(OnBehalfOfLocationID.FIELD, getField(header, SenderLocationID.FIELD));
            }
           
            return new SessionID(fixVersion, gatewayCompId, gatewaySubId, gatewayLocationId,
                destinationCompId, destinationSubId, destinationLocationId, null);
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of quickfix.SessionID

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.