Package org.apache.camel.spring

Examples of org.apache.camel.spring.SpringRouteBuilder


    }

    @Test
    public void testRollbackUsingXmlQueueToQueueRequestReplyUsingDynamicMessageSelector() throws Exception {
        final ConditionalExceptionProcessor cp = new ConditionalExceptionProcessor(5);
        context.addRoutes(new SpringRouteBuilder() {
            @Override
            public void configure() throws Exception {
                Policy required = lookup("PROPAGATION_REQUIRED_POLICY", SpringTransactionPolicy.class);

                from("activemq:queue:foo").policy(required).process(cp).to("activemq-1:queue:bar?replyTo=queue:bar.reply");
View Full Code Here


   
    @Test
    public void testNoTransactionRollbackUsingXmlQueueToQueue() throws Exception {

        // configure routes and add to camel context
        context.addRoutes(new SpringRouteBuilder() {

            @Override
            public void configure() throws Exception {
                errorHandler(noErrorHandler());
                from("activemq:queue:foo?transacted=false").process(new ConditionalExceptionProcessor())
View Full Code Here

    @Test
    public void testRollbackUsingXmlQueueToQueue() throws Exception {

        // configure routes and add to camel context
        context.addRoutes(new SpringRouteBuilder() {

            @Override
            public void configure() throws Exception {
                Policy required = lookup("PROPAGATION_REQUIRED_POLICY", SpringTransactionPolicy.class);
                from("activemq:queue:foo?transacted=true").policy(required).process(new ConditionalExceptionProcessor())
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

        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 {
                onException(IllegalArgumentException.class)
                        .handled(true).to("mock:error").transform(constant("Sorry")).markRollbackOnly();

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

* Unit test to demonstrate the transactional client pattern.
*/
public class TransactionalClientDataSourceTransactedWithLocalOnExceptionTest extends TransactionalClientDataSourceWithOnExceptionTest {

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                from("direct:okay")
                    .transacted()
                    // use local on exception
                    .onException(IllegalArgumentException.class).handled(false).to("mock:error")
View Full Code Here

* Using transaction error handler in the routes
*/
public class TransactionalClientDataSourceTransactionErrorHandlerTest extends TransactionalClientDataSourceTest {

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                // START SNIPPET: e1
                // use a global transaction error handler so all routes is transacted
                errorHandler(transactionErrorHandler());

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

        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

    private MockEndpoint mockEndpointC;
    private MockEndpoint mockEndpointD;

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

                SpringTransactionPolicy requried = new SpringTransactionPolicy(lookup("PROPAGATION_REQUIRED", TransactionTemplate.class));
                SpringTransactionPolicy notsupported = new SpringTransactionPolicy(lookup("PROPAGATION_NOT_SUPPORTED", TransactionTemplate.class));
                SpringTransactionPolicy requirenew = new SpringTransactionPolicy(lookup("PROPAGATION_REQUIRES_NEW", TransactionTemplate.class));
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.