Package org.apache.camel

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


        Exchange exchange = endpoint.createExchange();
        exchange.getIn().setBody("Hello World");
        exchange.getOut().setBody(22);

        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();
    }

    public void testSendExchangeWithException() throws Exception {
View Full Code Here


        Exchange exchange = endpoint.createExchange();
        exchange.getIn().setBody("Hello World");
        exchange.setException(new IllegalArgumentException("Damn"));

        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();
    }

    public void testSendCaughtExchangeWithException() throws Exception {
View Full Code Here

        Exchange exchange = endpoint.createExchange();
        exchange.getIn().setBody("Hello World");
        exchange.setProperty(Exchange.EXCEPTION_CAUGHT, new IllegalArgumentException("I am caught"));

        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();
    }

    public void testSendCaughtExchangeWithExceptionAndMultiline() throws Exception {
View Full Code Here

        Exchange exchange = endpoint.createExchange();
        exchange.getIn().setBody("Hello World");
        exchange.setProperty(Exchange.EXCEPTION_CAUGHT, new IllegalArgumentException("I am caught"));

        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();
    }

    public void testSendExchangeWithExceptionAndStackTrace() throws Exception {
View Full Code Here

        Exchange exchange = endpoint.createExchange();
        exchange.getIn().setBody("Hello World");
        exchange.setException(new IllegalArgumentException("Damn"));

        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();
    }

    public void testSendCaughtExchangeWithExceptionAndStackTrace() throws Exception {
View Full Code Here

        Exchange exchange = endpoint.createExchange();
        exchange.getIn().setBody("Hello World");
        exchange.setProperty(Exchange.EXCEPTION_CAUGHT, new IllegalArgumentException("I am caught"));

        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();
    }

    public void testConfiguration() {
View Full Code Here

        Endpoint endpoint = context.getEndpoint(getFtpUrl());
        Exchange exchange = endpoint.createExchange();
        exchange.getIn().setBody("Hello World this file will NOT be deleted");
        exchange.getIn().setHeader(Exchange.FILE_NAME, "hello.txt");
        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();

        // assert file is created
        File file = new File("./res/home/deletefile/hello.txt");
View Full Code Here

        Exchange exchange = endpoint.createExchange();
        exchange.getIn().setBody("Hello World");
        exchange.getOut().setBody(22);

        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();
    }

    public void testSendExchangeWithException() throws Exception {
View Full Code Here

        Exchange exchange = endpoint.createExchange();
        exchange.getIn().setBody("Hello World");
        exchange.setException(new IllegalArgumentException("Damn"));

        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();
    }

    public void testSendCaughtExchangeWithException() throws Exception {
View Full Code Here

        Exchange exchange = endpoint.createExchange();
        exchange.getIn().setBody("Hello World");
        exchange.setProperty(Exchange.EXCEPTION_CAUGHT, new IllegalArgumentException("I am caught"));

        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();
    }

    public void testSendCaughtExchangeWithExceptionAndMultiline() throws Exception {
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.