Package org.apache.camel.spring

Examples of org.apache.camel.spring.SpringRouteBuilder


        assertEquals(0, list.size());
    }

    @Override
    protected RouteBuilder createRouteBuilder() {
        return new SpringRouteBuilder() {
            @Override
            public void configure() {
                String options = "?consumer.skipLockedEntity=true"; //&consumer.lockModeType=PESSIMISTIC_FORCE_INCREMENT";
                from("jpa://" + VersionedItem.class.getName() + options).routeId("first").autoStartup(false).bean(new WaitLatch()).log("route1: ${body}").to("mock:result1");
                from("jpa2://select" + options + "&consumer.query=select s from VersionedItem s").routeId("second").autoStartup(false).bean(new WaitLatch()).log("route2: ${body}").to("mock:result2");
View Full Code Here


    private MockEndpoint mockEndpointC;
    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

    }

    @Override
    protected RouteBuilder createRouteBuilder() {
        // START SNIPPET: idempotent
        return new SpringRouteBuilder() {
            public void configure() {
                from("direct:start").idempotentConsumer(
                        header("messageId"),
                        jpaMessageIdRepository(bean(JpaTemplate.class), PROCESSOR_NAME)
                ).to("mock:result");
View Full Code Here

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

    private Logger log = Logger.getLogger(getClass());

    public void testRollbackUsingXmlQueueToQueue() throws Exception {

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

            @Override
            public void configure() throws Exception {

                Policy required = bean(SpringTransactionPolicy.class, "PROPAGATION_REQUIRED_POLICY");
View Full Code Here

    protected CamelContext createCamelContext() throws Exception {
        return SpringCamelContext.springCamelContext(createApplicationContext());
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                from("activemq:queue:mainStage?replyTo=queue:mainStage.reply").to("activemq:queue:request?replyTo=queue:request.reply");
            }
        };
    }
View Full Code Here

    private Logger log = Logger.getLogger(getClass());

    public void testRollbackUsingXmlQueueToProcessor() throws Exception {

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

            @Override
            public void configure() throws Exception {

                Policy required = bean(SpringTransactionPolicy.class, "PROPAGATION_REQUIRED_POLICY");
View Full Code Here

    public void testRollbackUsingXmlQueueToQueueRequestReplyUsingDynamicMessageSelector() throws Exception {

        JmsComponent c = (JmsComponent)context.getComponent("activemq");
        JmsComponent c1 = (JmsComponent)context.getComponent("activemq-1");
        final ConditionalExceptionProcessor cp = new ConditionalExceptionProcessor(10);
        context.addRoutes(new SpringRouteBuilder() {
            @Override
            public void configure() throws Exception {
                Policy required = bean(SpringTransactionPolicy.class, "PROPAGATION_REQUIRED_POLICY");
                from("activemq:queue:foo?replyTo=queue:foo.reply").policy(required).process(cp).to("activemq-1:queue:bar?replyTo=queue:bar.reply");
                from("activemq-1:queue:bar").process(new Processor() {
View Full Code Here

    private MockEndpoint mockEndpointC;
    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

    }

    @Override
    protected RouteBuilder createRouteBuilder() {
        // START SNIPPET: idempotent
        return new SpringRouteBuilder() {
            public void configure() {
                from("direct:start").idempotentConsumer(
                        header("messageId"),
                        jpaMessageIdRepository(bean(JpaTemplate.class), PROCESSOR_NAME)
                ).to("mock:result");
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.