Package quickfix

Examples of quickfix.SessionID


    private void sendQueuedMessages(int expectedValue, String session) throws SessionNotFound {
        Map<Integer, Object[]> messages = messagesMap.get(session);
        Object[] obj = messages.get(expectedValue);
        while (obj != null) {
            Message message = (Message) obj[0];
            SessionID sessionID = (SessionID) obj[1];
            MessageContext msgCtx = null;
            String targetEPR = null;
            if (obj[2] != null) {
                msgCtx = (MessageContext) obj[2];
                targetEPR = (String) obj[3];
View Full Code Here


            Map<Integer,  Object[]> messages = messagesMap.get(session);
            while (!messages.isEmpty()) {
                Object[] obj = messages.get(expectedValue);
                if (obj != null) {
                    Message message = (Message) obj[0];
                    SessionID sessionID = (SessionID) obj[1];

                    if (log.isDebugEnabled()) {
                        log.debug("Source session: " + session + " - Flushing the previously queued " +
                                "message with the sequence number: " + expectedValue);
                    }
View Full Code Here

    @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("", 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("", 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

        Message message = exchange.getIn().getBody(Message.class);
        if (log.isDebugEnabled()) {
            log.debug("Sending FIX message: " + message.toString());
        }
       
        SessionID messageSessionID = sessionID;
        if (messageSessionID == null) {
            messageSessionID = MessageUtils.getSessionID(message);
        }
       
        Session session = Session.lookupSession(messageSessionID);
View Full Code Here

        QuickfixjEndpoint mockEndpoint = Mockito.mock(QuickfixjEndpoint.class);
        org.apache.camel.Message mockCamelMessage = Mockito.mock(org.apache.camel.Message.class);
        Mockito.when(mockExchange.getIn()).thenReturn(mockCamelMessage);
        Mockito.when(mockCamelMessage.getBody(Message.class)).thenReturn(new Message());

        SessionID sessionID = new SessionID(FixVersions.BEGINSTRING_FIX44, "SENDER", "TARGET");      
        Mockito.when(mockEndpoint.getSessionID()).thenReturn(sessionID);
       
        QuickfixjProducer producer = new QuickfixjProducer(mockEndpoint);
       
        producer.process(mockExchange);
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.