Package org.apache.camel.impl

Examples of org.apache.camel.impl.DefaultCamelContext.createProducerTemplate()


    @Test
    public void testRmi() throws Exception {
        // Create a new camel context to send the request so we can test the service which is deployed into a container
        CamelContext camelContext = new DefaultCamelContext();
        ProducerTemplate myTemplate = camelContext.createProducerTemplate();
        myTemplate.start();
        try {
            String out = myTemplate.requestBody("rmi://localhost:37541/helloServiceBean", "Camel", String.class);
            assertEquals("Hello Camel", out);
        } finally {
View Full Code Here


        DefaultCamelContext camelContext = new DefaultCamelContext();
        camelContext.setRegistry(createRegistry());
        camelContext.addRoutes(this);
        camelContext.start();
       
        ProducerTemplate template = camelContext.createProducerTemplate();
       
        Order order = new Order(2);
        order.addItem(DrinkType.ESPRESSO, 2, true);
        order.addItem(DrinkType.CAPPUCCINO, 4, false);
        order.addItem(DrinkType.LATTE, 4, false);
View Full Code Here

        DefaultCamelContext camelContext = new DefaultCamelContext();
        camelContext.setRegistry(createRegistry());
        camelContext.addRoutes(this);
        camelContext.start();
       
        ProducerTemplate template = camelContext.createProducerTemplate();
       
        Order order = new Order(2);
        order.addItem(DrinkType.ESPRESSO, 2, true);
        order.addItem(DrinkType.CAPPUCCINO, 4, false);
        order.addItem(DrinkType.LATTE, 4, false);
View Full Code Here

            }
        });
        // END SNIPPET: e3
        // Camel template - a handy class for kicking off exchanges
        // START SNIPPET: e4
        ProducerTemplate template = context.createProducerTemplate();
        // END SNIPPET: e4
        // Now everything is set up - lets start the context
        context.start();
        // Now send some test text to a component - for this case a JMS Queue
        // The text get converted to JMS messages - and sent to the Queue
View Full Code Here

            context.start();

            MockEndpoint mock = context.getEndpoint("mock:result", MockEndpoint.class);
            mock.setExpectedMessageCount(1);

            ProducerTemplate template = context.createProducerTemplate();
            if (e != null) {
                template.send("direct:in", e);
            } else {
                template.sendBodyAndHeaders("direct:in", payload, headers);
            }
View Full Code Here

        MockEndpoint mock = ctx.getEndpoint("mock:result", MockEndpoint.class);
        mock.expectedPropertyReceived("addressLine1", addressLine1);

        String csvLine = "\"PROBLEM SOLVER\",\"" + addressLine1
                         + "\",\"SUITE 104\",\"RALEIGH\",\"NC\",\"27615\",\"US\"";
        ProducerTemplate template = ctx.createProducerTemplate();
        template.sendBody("direct:fromCsv", csvLine.trim());

       
        mock.assertIsSatisfied();
View Full Code Here

        MockEndpoint mock = ctx.getEndpoint("mock:result", MockEndpoint.class);
        mock.expectedPropertyReceived("addressLine1", addressLine1);

        String csvLine = "\"PROBLEM SOLVER\",\"" + addressLine1
                         + "\",\"SUITE 104\",\"RALEIGH\",\"NC\",\"27615\",\"US\"";
        ProducerTemplate template = ctx.createProducerTemplate();
        template.sendBody("direct:fromCsv", csvLine.trim());
       
        mock.assertIsSatisfied();

    }
View Full Code Here

        MockEndpoint mock = ctx.getEndpoint("mock:result", MockEndpoint.class);
        mock.expectedPropertyReceived("addressLine1", addressLine1);

        String csvLine = "\"PROBLEM SOLVER\",\"" + addressLine1
                         + "\",\"SUITE 104\",\"RALEIGH\",\"NC\",\"27615\",\"US\"";
        ProducerTemplate template = ctx.createProducerTemplate();
        template.sendBody("direct:fromCsv", csvLine.trim());
       
        mock.assertIsSatisfied();

    }
View Full Code Here

      
        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:51616");
       
        context.addComponent("test-jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
       
        ProducerTemplate template = context.createProducerTemplate();
       
        context.start();
       
        for (int i = 0; i < 10; i++) {
            template.sendBody("test-jms:queue:test.queue", "Test Message: " + i);
View Full Code Here

public class RedeliveryErrorHandlerAsyncDelayedTwoCamelContextIssueTest {

    @Test
    public void shouldNotBreakRedeliveriesOfSecondContextAfterFirstBeingStopped() throws Exception {
        DefaultCamelContext context1 = createContext();
        ProducerTemplate producer1 = context1.createProducerTemplate();
        ConsumerTemplate consumer1 = context1.createConsumerTemplate();
        context1.start();
        producer1.sendBody("seda://input", "Hey1");
        Exchange ex1 = consumer1.receive("seda://output", 5000);
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.