Package org.apache.camel.spring

Examples of org.apache.camel.spring.SpringRouteBuilder


        // should get 2 books as the first operation will succeed and we are not transacted
        assertEquals("Number of books", 2, count);
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                // ignore failure if its something with Donkey
                onException(IllegalArgumentException.class).onWhen(exceptionMessage().contains("Donkey")).handled(true);

                from("direct:okay")
View Full Code Here


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

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                // use required as transaction policy
                SpringTransactionPolicy required = lookup("PROPAGATION_REQUIRED", SpringTransactionPolicy.class);

                // configure to use transaction error handler and pass on the required as it will fetch
View Full Code Here

        assertMockEndpointsSatisfied();
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                onException(IllegalArgumentException.class).handled(false).to("mock:error");

                from("file://target/transacted/okay")
                    .transacted()
View Full Code Here

        // 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

        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
                // with 100 millis delay between each redelivery attempt
                // we have not passed in any spring TX manager. Camel will automatic
                // find it in the spring application context. You only need to help
View Full Code Here

        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

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

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                // use required as transaction policy
                SpringTransactionPolicy required = lookup("PROPAGATION_REQUIRED", SpringTransactionPolicy.class);

                // configure to use transaction error handler and pass on the required as it will fetch
View Full Code Here

        // there should be 2 books as the first insert operation succeeded
        assertEquals("Number of books", 2, count);
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                // START SNIPPET: e1

                // on exception is also supported
                // so if an IllegalArgumentException is thrown then we route it to the mock:error
View Full Code Here

* @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

        // should get 2 books as the first operation will succeed and we are not transacted
        assertEquals("Number of books", 2, count);
    }

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

TOP

Related Classes of org.apache.camel.spring.SpringRouteBuilder

Copyright © 2018 www.massapicom. 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.