Package org.apache.camel

Examples of org.apache.camel.Producer.createExchange()


        String uri = pe.getEndpointUri();
        assertEquals("cheese", uri);

        Producer producer = pe.createProducer();
        Exchange exchange = producer.createExchange();
        exchange.getIn().setBody("World");

        producer.start();
        producer.process(exchange);
        producer.stop();
View Full Code Here


        String uri = pe.getEndpointUri();
        assertEquals("bean:generated:MyFooBean", uri);

        Producer producer = pe.createProducer();
        Exchange exchange = producer.createExchange();
        exchange.getIn().setBody("World");

        producer.start();
        producer.process(exchange);
        producer.stop();
View Full Code Here

        String uri = pe.getEndpointUri();
        assertEquals("cheese", uri);

        Producer producer = pe.createProducer();
        Exchange exchange = producer.createExchange();
        exchange.getIn().setBody("World");

        producer.start();
        producer.process(exchange);
        producer.stop();
View Full Code Here

        Email email = TestSupport.createEmailMessage("Dynamic Routing Example");
        email.getHeader().setString(DeliverToCompID.FIELD, "TRADER@2");
       
        LOG.info("Sending routed message");
       
        Exchange exchange = producer.createExchange(ExchangePattern.InOnly);
        exchange.getIn().setBody(email);
        producer.process(exchange);           

        if (!receivedMessageLatch.await(5, TimeUnit.SECONDS)) {
            throw new IllegalStateException("Message did not reach target");
View Full Code Here

        });
        thread.start();

        Producer producer = context.getEndpoint("direct:foo").createProducer();
        for (int i = 0; i < numberOfMessages; i++) {
            Exchange exchange = producer.createExchange();
            exchange.getIn().setBody("test message " + i);
            producer.process(exchange);
        }
        latch.await(20, TimeUnit.SECONDS);
        assertTrue("Messages not consumed = " + latch.getCount(), latch.getCount() == 0);
View Full Code Here

        Endpoint producerEndpoint = component.createEndpoint(getEndpointUri(settingsFile.getName(), acceptorSessionID));
        Producer producer = producerEndpoint.createProducer();
       
        // FIX message to send
        Email email = new Email(new EmailThreadID("ID"), new EmailType(EmailType.NEW), new Subject("Test"));
        Exchange exchange = producer.createExchange(ExchangePattern.InOnly);
        exchange.getIn().setBody(email);
       
        producer.process(exchange);           

        // Produce with no session ID specified, session ID must be in message
View Full Code Here

    }

    private Exchange sendExchange(boolean setException) throws Exception {
        Endpoint endpoint = context.getEndpoint(String.format("mina2:tcp://localhost:%1$s?sync=true&encoding=UTF-8&transferExchange=true", getPort()));
        Producer producer = endpoint.createProducer();
        Exchange exchange = producer.createExchange();
        //Exchange exchange = endpoint.createExchange();

        Message message = exchange.getIn();
        message.setBody("Hello!");
        message.setHeader("cheese", "feta");
View Full Code Here

    }

    private Exchange sendExchange(boolean setException) throws Exception {
        Endpoint endpoint = context.getEndpoint(String.format("mina2:tcp://localhost:%1$s?sync=true&encoding=UTF-8&transferExchange=true", getPort()));
        Producer producer = endpoint.createProducer();
        Exchange exchange = producer.createExchange();
        //Exchange exchange = endpoint.createExchange();

        Message message = exchange.getIn();
        message.setBody("Hello!");
        message.setHeader("cheese", "feta");
View Full Code Here

        });
        thread.start();

        Producer producer = context.getEndpoint("direct:foo").createProducer();
        for (int i = 0; i < numberOfMessages; i++) {
            Exchange exchange = producer.createExchange();
            exchange.getIn().setBody("test message " + i);
            producer.process(exchange);
        }
        latch.await(20, TimeUnit.SECONDS);
View Full Code Here

        Endpoint producerEndpoint = component.createEndpoint(getEndpointUri(settingsFile.getName(), acceptorSessionID));
        Producer producer = producerEndpoint.createProducer();
       
        // FIX message to send
        Email email = new Email(new EmailThreadID("ID"), new EmailType(EmailType.NEW), new Subject("Test"));
        Exchange exchange = producer.createExchange(ExchangePattern.InOnly);
        exchange.getIn().setBody(email);
       
        producer.process(exchange);           

        // Produce with no session ID specified, session ID must be in message
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.