Examples of SpringRouteBuilder


Examples of org.apache.camel.spring.SpringRouteBuilder

        assertEquals(1, jdbc.queryForInt("select count(*) from books where title = 'Lion in Action'"));
        assertEquals(1, jdbc.queryForInt("select count(*) from books where title = 'Crocodile in Action'"));
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                from("direct:okay")
                    .transacted("PROPAGATION_REQUIRED")
                    .setBody(constant("Tiger in Action")).beanRef("bookService")
                    .setBody(constant("Elephant in Action")).beanRef("bookService");
View Full Code Here

Examples of org.apache.camel.spring.SpringRouteBuilder

    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        // Notice that we use the SpringRouteBuilder that has a few more features than
        // the standard RouteBuilder
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                // setup the transaction policy
                SpringTransactionPolicy required = lookup("PROPAGATION_REQUIRED", SpringTransactionPolicy.class);

                // use transaction error handler
View Full Code Here

Examples of org.apache.camel.spring.SpringRouteBuilder

        // the tiger in action should be committed, but our 2nd route should rollback
        assertEquals("Number of books", 2, count);
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                from("direct:required")
                    .transacted("PROPATATION_REQUIRED")
                    .beanRef("bookService");
View Full Code Here

Examples of org.apache.camel.spring.SpringRouteBuilder

        return SpringCamelContext.springCamelContext(applicationContext);
    }

    @Override
    protected RouteBuilder createRouteBuilder() {
        return new SpringRouteBuilder() {
            public void configure() {
                from("direct:start").to("jpa://" + SendEmail.class.getName()).to("mock:result");
            }
        };
    }
View Full Code Here

Examples of org.apache.camel.spring.SpringRouteBuilder

        return SpringCamelContext.springCamelContext(applicationContext);
    }

    @Override
    protected RouteBuilder createRouteBuilder() {
        return new SpringRouteBuilder() {
            public void configure() {
                Tracer tracer = new Tracer();
                tracer.setDestinationUri("jpa://" + JpaTraceEventMessage.class.getName() + "?persistenceUnit=trace");
                tracer.setUseJpa(true);
                getContext().addInterceptStrategy(tracer);
View Full Code Here

Examples of org.apache.camel.spring.SpringRouteBuilder

* @version
*/
public class TransactionalClientDataSourceTransactedWithFileLocalOnExceptionTest extends TransactionalClientDataSourceTransactedWithFileOnExceptionTest {

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {

                from("file://target/transacted/okay")
                    .transacted()
                    .setBody(constant("Tiger in Action")).beanRef("bookService")
View Full Code Here

Examples of org.apache.camel.spring.SpringRouteBuilder

    private MockEndpoint mockEndpointD;


    @Override
    protected RouteBuilder createRouteBuilder() {
        return new SpringRouteBuilder() {
            public void configure() {

                Policy requried = new SpringTransactionPolicy(bean(TransactionTemplate.class, "PROPAGATION_REQUIRED"));
                Policy notsupported = new SpringTransactionPolicy(bean(TransactionTemplate.class, "PROPAGATION_NOT_SUPPORTED"));
                Policy requirenew = new SpringTransactionPolicy(bean(TransactionTemplate.class, "PROPAGATION_REQUIRES_NEW"));
View Full Code Here

Examples of org.apache.camel.spring.SpringRouteBuilder

        assertEquals(true, out.getProperty(Exchange.FAILURE_HANDLED));
        assertEquals(false, out.getProperty(Exchange.ERRORHANDLER_HANDLED));
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                // configure transacted error handler to use up till 4 redeliveries
                // we have not passed in any spring TX manager. Camel will automatic
                // find it in the spring application context. You only need to help
                // Camel in case you have multiple TX managers
View Full Code Here

Examples of org.apache.camel.spring.SpringRouteBuilder

        int count = jdbc.queryForInt("select count(*) from books");
        assertEquals("Number of books", 4, count);
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                from("direct:okay")
                    .transacted("PROPAGATION_REQUIRED")
                    .setBody(constant("Tiger in Action")).beanRef("bookService")
                    .setBody(constant("Elephant in Action")).beanRef("bookService");
View Full Code Here

Examples of org.apache.camel.spring.SpringRouteBuilder

* @version $Revision: 935198 $
*/
public class TransactionalClientDataSourceTransactedWithFileLocalOnExceptionTest extends TransactionalClientDataSourceTransactedWithFileOnExceptionTest {

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {

                from("file://target/transacted/okay")
                    .transacted()
                    .setBody(constant("Tiger in Action")).beanRef("bookService")
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.