Package org.apache.camel.impl

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


            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

            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

                    }
                }
            });

            camelContext.start();
            producerTemplate = camelContext.createProducerTemplate();
            LOGGER.info("Camel (Insight Message Producer) started successfully");
        } catch (Exception e) {
            LOGGER.error("Error starting the Camel context: " + e.getMessage(), e);
            throw new RuntimeException(e);
        }
View Full Code Here

        // Start the context
        context.start();

        // Send a couple of messages to get some route statistics
        final ProducerTemplate template = context.createProducerTemplate();
        template.sendBody("direct:start", "Hello Camel");
        template.sendBody("direct:start", "Camel Rocks!");

        // let the Camel runtime do its job for a while
        Thread.sleep(60000);
View Full Code Here

        // Start the context
        context.start();

        // Send a couple of messages to get some route statistics
        final ProducerTemplate template = context.createProducerTemplate();
        template.sendBody("direct:start", "Hello Camel");
        template.sendBody("direct:start", "Camel Rocks!");

        // let the Camel runtime do its job for a while
        Thread.sleep(60000);
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

            }
        });
        // 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

        ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:51616");
        // Note we can explicit name of the component
        context.addComponent("jms", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory));
        context.start();

        ProducerTemplate template = context.createProducerTemplate();

        String out = template.requestBodyAndHeader("jms:queue:loan", null, Constants.PROPERTY_SSN, "Client-A", String.class);
        System.out.println(out);

        template.stop();
View Full Code Here

    @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 myContext = new DefaultCamelContext();
        ProducerTemplate myTemplate = myContext.createProducerTemplate();
        myTemplate.start();
        try {
            System.out.println("Calling on port " + port);
            String out = myTemplate.requestBody("rmi://localhost:" + port + "/helloServiceBean", "Camel", String.class);
            assertEquals("Hello Camel", out);
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.