Package org.apache.camel.impl

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


                from("direct:start").beanRef("foo");
            }
        });
        camel.start();

        String reply = camel.createProducerTemplate().requestBody("direct:start", "Camel", String.class);
        assertEquals("Hello Camel", reply);

        camel.stop();
    }
View Full Code Here


        // Note we can explicit name of the component
        context.addComponent("jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));

        context.addRoutes(new Client());

        ProducerTemplate template = context.createProducerTemplate();

        context.start();

        // send out the request message
        for (int i = 0; i < 2; i++) {
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

public class VmMultipleConsumersKeepRouteTest extends TestCase {

    public void testVmMultipleConsumersKeepRoute() throws Exception {
        CamelContext camelContext = new DefaultCamelContext();
        ProducerTemplate producerTemplate = camelContext.createProducerTemplate();

        RouteBuilder builder = new RouteBuilder(camelContext) {
            @Override
            public void configure() throws Exception {
                from("vm:producer?multipleConsumers=true").routeId("route1").to("mock:route1");
View Full Code Here

public class VmMultipleConsumersMultipleContextTest extends ContextTestSupport {

    public void testMultipleVMConsumersSameContext() throws Exception {
        CamelContext camelContext = new DefaultCamelContext();
        ProducerTemplate producerTemplate = camelContext.createProducerTemplate();

        RouteBuilder builder = new RouteBuilder(camelContext) {
            @Override
            public void configure() throws Exception {
                from("vm:producer?multipleConsumers=true").routeId("route1").to("mock:route1");
View Full Code Here

    public static void main(String[] args) throws Exception {
        LOG.info("About to run splunk-camel integration...");

        CamelContext camelContext = new DefaultCamelContext();
        camelContext.addRoutes(new SplunkPublishEventRouteBuilder());
        ProducerTemplate eventProducer = camelContext.createProducerTemplate();
        camelContext.start();
        eventProducer.request("direct:start", new SplunkEventProcessor());

        LOG.info("Successfully published event to Splunk.");
View Full Code Here

        ctx.start();

        Map<String, String> body = new HashMap<String, String>();
        body.put("p", "q");

        ProducerTemplate template = ctx.createProducerTemplate();
        // Initial one, it's a dry start, we don't care about this one.
        template.sendBody("direct:start", body);

        // Measure the duration of the executions in nanoseconds
        long totalNsDuration = 0;
View Full Code Here

public class VmMultipleConsumersRemoteRouteTest extends TestCase {

    public void testVmMultipleConsumersRemoteRoute() throws Exception {
        CamelContext camelContext = new DefaultCamelContext();
        ProducerTemplate producerTemplate = camelContext.createProducerTemplate();

        RouteBuilder builder = new RouteBuilder(camelContext) {
            @Override
            public void configure() throws Exception {
                from("vm:producer?multipleConsumers=true").routeId("route1").to("mock:route1");
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.