Package quickfix

Examples of quickfix.Message


            this.password = password;
        }

        public void inject(Exchange exchange) throws InvalidPayloadException {
            LOG.info("Injecting password into outgoing logon message");
            Message message = ExchangeHelper.getMandatoryInBody(exchange, Message.class);
            message.setString(RawData.FIELD, password);
            message.setInt(RawDataLength.FIELD, password.length());
        }
View Full Code Here


    public FixMessageRouter(String engineUri) {
        this.engineUri = engineUri;
    }
   
    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);
View Full Code Here

     *
     * @param exchange the normalized message
     * @throws Exception
     */
    public void process(Exchange exchange) throws Exception {
        Message message = toQuickMessage(exchange);

        if (LOG.isDebugEnabled()) {
            LOG.debug("Sending FIX message : " + message);
        }
        endpoint.getSession().send(message);
View Full Code Here

*/
public class QuickFixDataFormat implements DataFormat {

    public void marshal(Exchange exchange, Object body, OutputStream outputStream) throws Exception {
        Message message = ExchangeHelper.convertToMandatoryType(exchange, Message.class, body);
        String fixMessage = QuickFixConverter.toString(message);
        outputStream.write(fixMessage.getBytes());
    }
View Full Code Here

        outputStream.write(fixMessage.getBytes());
    }

    public Object unmarshal(Exchange exchange, InputStream inputStream) throws Exception {
        String body = ExchangeHelper.convertToMandatoryType(exchange, String.class, inputStream);
        Message message = QuickFixConverter.toMessage(body);
        return message;

    }
View Full Code Here

            // using the default encoding
            str = baos.toString();
        }
        in.close();
       
        return new Message(str);
    }
View Full Code Here

        return message.toString();
    }
   
    @Converter
    public static Message toMessage(String message) throws IOException, InvalidMessage {
        return new Message(message);
    }
View Full Code Here

        Mockito.when(mockExchange.getPattern()).thenReturn(ExchangePattern.InOnly);
       
        quickfixjEngine = TestSupport.createEngine();
        Mockito.when(mockEndpoint.getEngine()).thenReturn(quickfixjEngine);
       
        inboundFixMessage = new Message();
        inboundFixMessage.getHeader().setString(BeginString.FIELD, FixVersions.BEGINSTRING_FIX44);
        inboundFixMessage.getHeader().setString(SenderCompID.FIELD, "SENDER");
        inboundFixMessage.getHeader().setString(TargetCompID.FIELD, "TARGET");
        sessionID = MessageUtils.getSessionID(inboundFixMessage);
  
View Full Code Here

            1000L, Long.class)).thenReturn(5000L);
               
        org.apache.camel.Message mockOutboundCamelMessage = Mockito.mock(org.apache.camel.Message.class);
        Mockito.when(mockExchange.getOut()).thenReturn(mockOutboundCamelMessage);
       
        final Message outboundFixMessage = new Email();
        outboundFixMessage.getHeader().setString(SenderCompID.FIELD, "TARGET");
        outboundFixMessage.getHeader().setString(TargetCompID.FIELD, "SENDER");
       
        Session mockSession = Mockito.spy(TestSupport.createSession(sessionID));
        Mockito.doReturn(mockSession).when(producer).getSession(MessageUtils.getSessionID(inboundFixMessage));
        Mockito.doAnswer(new Answer<Boolean>() {
            @Override
View Full Code Here

            1000L, Long.class)).thenReturn(5000L);
               
        org.apache.camel.Message mockOutboundCamelMessage = Mockito.mock(org.apache.camel.Message.class);
        Mockito.when(mockExchange.getOut()).thenReturn(mockOutboundCamelMessage);
               
        final Message outboundFixMessage = new Email();
        outboundFixMessage.getHeader().setString(SenderCompID.FIELD, "TARGET");
        outboundFixMessage.getHeader().setString(TargetCompID.FIELD, "SENDER");
       
        Session mockSession = Mockito.spy(TestSupport.createSession(sessionID));
        Mockito.doReturn(mockSession).when(producer).getSession(MessageUtils.getSessionID(inboundFixMessage));
        Mockito.doAnswer(new Answer<Boolean>() {
            @Override
View Full Code Here

TOP

Related Classes of quickfix.Message

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.