Package org.apache.camel

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


            producer.process(exchange);
            fail("Should have thrown an ExchangeTimedOutException wrapped in a RuntimeCamelException");
        } catch (Exception e) {
            assertTrue("Should have thrown an ExchangeTimedOutException", e instanceof ExchangeTimedOutException);
        }
        producer.stop();
    }

    protected RouteBuilder createRouteBuilder() {
        return new RouteBuilder() {
View Full Code Here


                Producer producer;
                try {
                    producer = endpoint.createProducer();
                    producer.start();
                    producer.process(exchange);
                    producer.stop();
                } catch (Exception e) {
                    throw ObjectHelper.wrapRuntimeCamelException(e);
                }

                // return the OUT body, but check for exchange pattern
View Full Code Here

        int response = exchange.getOut().getBody(Integer.class);
       
        assertEquals("Get a wrong response.", 33, response);

        // stop and exit the client
        producer.stop();
        context.stop();
       
    }
   
    protected void camelRemotingInvocation() {
View Full Code Here

        // get the response from the out body and cast it to an integer
        int response = exchange.getOut().getBody(Integer.class);
        System.out.println("... the result is: " + response);

        // stop and exit the client
        producer.stop();
        System.exit(0);
    }
    // END SNIPPET: e1

}
View Full Code Here

                Producer producer;
                try {
                    producer = endpoint.createProducer();
                    producer.start();
                    producer.process(exchange);
                    producer.stop();
                } catch (Exception e) {
                    throw ObjectHelper.wrapRuntimeCamelException(e);
                }

                // return the OUT body, but check for exchange pattern
View Full Code Here

        // get the response from the out body and cast it to an integer
        int response = exchange.getOut().getBody(Integer.class);
        System.out.println("... the result is: " + response);

        // stop and exit the client
        producer.stop();
        System.exit(0);
    }
    // END SNIPPET: e1

}
View Full Code Here

                Producer producer;
                try {
                    producer = endpoint.createProducer();
                    producer.start();
                    producer.process(exchange);
                    producer.stop();
                } catch (Exception e) {
                    throw ObjectHelper.wrapRuntimeCamelException(e);
                }

                // return the OUT body, but check for exchange pattern
View Full Code Here

        boolean received = latch.await(5, TimeUnit.SECONDS);
        assertTrue("Did not receive the message!", received);
        assertNotNull(receivedExchange.getIn());
        assertEquals("!olleH", receivedExchange.getIn().getBody());

        producer.stop();
        container.stop();
        server.stop();
    }

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

        boolean received = latch.await(5, TimeUnit.SECONDS);
        assertTrue("Did not receive the message!", received);
        assertNotNull(receivedExchange.getIn());
        assertEquals("!olleH", receivedExchange.getIn().getBody());

        producer.stop();
        container.stop();
        server.stop();
    }

    protected RouteBuilder createRouteBuilder() {
View Full Code Here

        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");
        file = file.getAbsoluteFile();
        assertTrue("The file should exists", file.exists());
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.