Examples of sendBodyAndHeader()


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

        MockEndpoint mock = ctx.getEndpoint("mock:results", MockEndpoint.class);
        ProducerTemplate template = ctx.createProducerTemplate();
        mock.expectedMessageCount(2);

        template.sendBodyAndHeader("direct:start", "Test 1", JcloudsConstants.BLOB_NAME, "blob1");
        template.sendBodyAndHeader("direct:start", "Test 2", JcloudsConstants.BLOB_NAME, "blob2");

        assertMockEndpointsSatisfied();

        template.stop();
View Full Code Here

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

        MockEndpoint mock = ctx.getEndpoint("mock:results", MockEndpoint.class);
        ProducerTemplate template = ctx.createProducerTemplate();
        mock.expectedMessageCount(2);

        template.sendBodyAndHeader("direct:start", "Test 1", JcloudsConstants.BLOB_NAME, "blob1");
        template.sendBodyAndHeader("direct:start", "Test 2", JcloudsConstants.BLOB_NAME, "blob2");

        assertMockEndpointsSatisfied();

        template.stop();
    }
View Full Code Here

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

        context.start();

        // send out the request message
        for (int i = 0; i < 2; i++) {
            template.sendBodyAndHeader("jms:queue:loanRequestQueue",
                                       "Quote for the lowest rate of loaning bank",
                                       Constants.PROPERTY_SSN, "Client-A" + i);
            Thread.sleep(100);
        }
        // wait for the response
View Full Code Here

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

       
        String expectedBody = "<matched/>";

        resultEndpoint.expectedBodiesReceived(expectedBody);

        template.sendBodyAndHeader("direct:start", expectedBody, "foo", "bar");

        resultEndpoint.assertIsSatisfied();
       
        resultEndpoint.reset();
       
View Full Code Here

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

       
        resultEndpoint.reset();
       
        resultEndpoint.expectedMessageCount(0);

        template.sendBodyAndHeader("direct:start", "<notMatched/>", "foo", "notMatchedHeaderValue");

        resultEndpoint.assertIsSatisfied();
    }

}
View Full Code Here

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

        context.start();
        // START SNIPPET: sending
        // send out the request message
        for (int i = 0; i < 2; i++) {
            template.sendBodyAndHeader("test-jms:queue:loanRequestQueue",
                                       "Quote for the lowerst rate of loaning bank",
                                       Constants.PROPERTY_SSN, "Client" + i);
            Thread.sleep(100);
        }
        // END SNIPPET: sending
View Full Code Here

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

        // do our testing
        MockEndpoint mock = ctx.getEndpoint("mock:result", MockEndpoint.class);
        mock.expectedMessageCount(1);

        myTemplate.sendBodyAndHeader("file:target/foo", "Hello World", Exchange.FILE_NAME, "hello.txt");

        mock.assertIsSatisfied();

        myTemplate.stop();
    }
View Full Code Here

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

        assertNotNull(camelContext);

        ProducerTemplate template = camelContext.createProducerTemplate();
        List<String> params = new ArrayList<String>();
        params.add("Willem");
        Object result = template.sendBodyAndHeader("cxf://bean:serviceEndpoint", ExchangePattern.InOut ,
                                                   params, CxfConstants.OPERATION_NAME, "greetMe");
        assertTrue("Result is a list instance ", result instanceof List);
        assertEquals("Get the wrong response", ((List)result).get(0), "HelloWillem");

        template.stop();
View Full Code Here

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

        // do our testing
        MockEndpoint mock = ctx.getEndpoint("mock:result", MockEndpoint.class);
        mock.expectedMessageCount(1);

        myTemplate.sendBodyAndHeader("file:target/foo", "Hello World", Exchange.FILE_NAME, "hello.txt");

        mock.assertIsSatisfied();

        myTemplate.stop();
    }
View Full Code Here

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

        producer.start();

        getMockEndpoint("mock:result").expectedMessageCount(3);

        producer.sendBody("Hello");
        producer.sendBodyAndHeader("Hello", "foo", 123);
        Map<String, Object> headers = new HashMap<String, Object>();
        producer.sendBodyAndHeaders("Hello", headers);

        assertMockEndpointsSatisfied();
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.