Examples of sendBody()


Examples of org.apache.camel.ProducerTemplate.sendBody()

        MockEndpoint result = camel1.getEndpoint("mock:result", MockEndpoint.class);
        result.expectedBodiesReceived(body);

        ProducerTemplate template = camel1.createProducerTemplate();
        template.start();
        template.sendBody("direct:start", body);
        template.stop();

        result.assertIsSatisfied();
    }
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBody()

        MockEndpoint result = camel2.getEndpoint("mock:result", MockEndpoint.class);
        result.expectedBodiesReceived(body);

        ProducerTemplate template = camel2.createProducerTemplate();
        template.start();
        template.sendBody("direct:start", body);
        template.stop();

        result.assertIsSatisfied();
    }
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBody()

        MockEndpoint result = camel1.getEndpoint("mock:result", MockEndpoint.class);
        result.expectedMessageCount(0);

        ProducerTemplate template = camel1.createProducerTemplate();
        template.start();
        template.sendBody("direct:foo", body);
        template.stop();

        Thread.sleep(200);
       
        result.assertIsSatisfied();
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBody()

        MockEndpoint foo = camel2.getEndpoint("mock:foo", MockEndpoint.class);
        foo.expectedBodiesReceived(body);

        ProducerTemplate template = camel2.createProducerTemplate();
        template.start();
        template.sendBody("direct:foo", body);
        template.stop();

        result.assertIsSatisfied();
        foo.assertIsSatisfied();
    }
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBody()

    @ManagedOperation(description = "Send body (in only)")
    public void sendBody(String endpointUri, String body) throws Exception {
        ProducerTemplate template = context.createProducerTemplate();
        try {
            template.sendBody(endpointUri, body);
        } finally {
            template.stop();
        }
    }
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBody()

        // get the camel template for Spring template style sending of messages (= producer)
        ProducerTemplate camelTemplate = (ProducerTemplate) context.getBean("camelTemplate");
       
        // as opposed to the CamelClientRemoting example we need to define the service URI in this java code
        int response = (Integer)camelTemplate.sendBody("jms:queue:numbers", ExchangePattern.InOut, 22);
       
        assertEquals("Get a wrong response", 66, response);
       
        context.stop();
    }
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBody()

        assertEquals("Size should be 0", 0, template.getCurrentCacheSize());

        // test that we cache at most 500 producers to avoid it eating to much memory
        for (int i = 0; i < 203; i++) {
            Endpoint e = context.getEndpoint("direct:queue:" + i);
            template.sendBody(e, "Hello");
        }

        assertEquals("Size should be 200", 200, template.getCurrentCacheSize());
        template.stop();
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBody()

        assertEquals("Size should be 0", 0, template.getCurrentCacheSize());

        // test that we cache at most 500 producers to avoid it eating to much memory
        for (int i = 0; i < 503; i++) {
            Endpoint e = context.getEndpoint("direct:queue:" + i);
            template.sendBody(e, "Hello");
        }

        assertEquals("Size should be 500", 500, template.getCurrentCacheSize());
        template.stop();
View Full Code Here

Examples of org.apache.camel.ProducerTemplate.sendBody()

        MockEndpoint mock = ctx.getEndpoint("mock:result", MockEndpoint.class);
        mock.expectedBodiesReceived("<?xml version=\"1.0\" encoding=\"UTF-8\"?><goodbye>world!</goodbye>");
        mock.message(0).body().isInstanceOf(String.class);

        template.sendBody("direct:start", "<hello>world!</hello>");

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

Examples of org.apache.camel.ProducerTemplate.sendBody()

        mock.message(0).header("foo").isInstanceOf(Boolean.class);
        mock.message(0).header("foo").isEqualTo(true);
        mock.message(0).header("bar").isInstanceOf(Boolean.class);
        mock.message(0).header("bar").isEqualTo(false);

        template.sendBody("direct:start", "<hello>World</hello>");

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