Examples of createProducerTemplate()


Examples of org.apache.camel.CamelContext.createProducerTemplate()

    }

    public void testCxfBusConfiguration() throws Exception {
        // get the camelContext from application context
        CamelContext camelContext = (CamelContext) ctx.getBean("camel");
        ProducerTemplate template = camelContext.createProducerTemplate();
        try {
            template.send("cxf:bean:serviceEndpoint", new Processor() {
                public void process(final Exchange exchange) {
                    final List<String> params = new ArrayList<String>();
                    params.add("hello");
View Full Code Here

Examples of org.apache.camel.CamelContext.createProducerTemplate()

        mockB.expectedBodiesReceived("Hello B");

        ProducerTemplate producer1 = camelA.createProducerTemplate();
        producer1.sendBody("direct:start1", "Hello A");

        ProducerTemplate producer2 = camelB.createProducerTemplate();
        producer2.sendBody("direct:start2", "Hello B");

        // make sure we properly stop the services we created
        ServiceHelper.stopServices(producer1, producer2);
View Full Code Here

Examples of org.apache.camel.CamelContext.createProducerTemplate()

       
        context.stopRoute("testRoute", 0, TimeUnit.MILLISECONDS);
       
        Thread.sleep(4000);
        assertTrue(context.getRouteStatus("testRoute") == ServiceStatus.Started);
        context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I come");

        context.stop();
        mock.assertIsSatisfied();
    }
View Full Code Here

Examples of org.apache.camel.CamelContext.createProducerTemplate()

        CamelContext context = startRouteWithPolicy("stopPolicy");
       
        Thread.sleep(4000);
        assertTrue(context.getRouteStatus("testRoute") == ServiceStatus.Stopped);
        try {
            context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I come");
        } catch (CamelExecutionException e) {
            consumerStopped = true;
        }   
        context.stop();
        assertTrue(consumerStopped);
View Full Code Here

Examples of org.apache.camel.CamelContext.createProducerTemplate()

        CamelContext context = startRouteWithPolicy("suspendPolicy");
       
        Thread.sleep(4000);
        try {
            context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I come");
        } catch (CamelExecutionException e) {
            consumerSuspended = true;
        }       
       
        context.stop();
View Full Code Here

Examples of org.apache.camel.CamelContext.createProducerTemplate()

        mock.expectedMinimumMessageCount(1);

        ServiceHelper.suspendService(context.getRoute("testRoute").getConsumer());
       
        Thread.sleep(4000);
        context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I come");
       
        context.stop();
        mock.assertIsSatisfied();
    }
   
View Full Code Here

Examples of org.apache.camel.CamelContext.createProducerTemplate()

            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

Examples of org.apache.camel.CamelContext.createProducerTemplate()

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

        context.addRoutes(new Client());

        ProducerTemplate template = context.createProducerTemplate();

        context.start();
        // START SNIPPET: sending
        // send out the request message
        for (int i = 0; i < 2; i++) {
View Full Code Here

Examples of org.apache.camel.CamelContext.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

Examples of org.apache.camel.CamelContext.createProducerTemplate()

       
        context.stopRoute("testRoute", 0, TimeUnit.MILLISECONDS);
       
        Thread.sleep(4000);
        assertTrue(context.getRouteStatus("testRoute") == ServiceStatus.Started);
        context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I come");

        context.stop();
        mock.assertIsSatisfied();
    }
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.