Package org.apache.camel.spi

Examples of org.apache.camel.spi.IdempotentRepository


            assertEquals("ws is down", ExceptionUtils.getRootCause(cee).getMessage());
        }

        assertMockEndpointsSatisfied();
        assertEquals(0, auditLogDao.getAuditCount(message)); // the insert was successful
        IdempotentRepository idempotentRepository = getMandatoryBean(IdempotentRepository.class, "jdbcIdempotentRepository");

        // the repository has not seen this messageId
        assertTrue(!idempotentRepository.contains("foo"));
    }
View Full Code Here


    public void testNotEager() throws Exception {
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                final IdempotentRepository repo = MemoryIdempotentRepository.memoryIdempotentRepository(200);

                from("direct:start").idempotentConsumer(header("messageId"), repo).eager(false).
                        process(new Processor() {
                            public void process(Exchange exchange) throws Exception {
                                String id = exchange.getIn().getHeader("messageId", String.class);
                                // should not contain
                                assertFalse("Should not eager add to repo", repo.contains(id));
                            }
                        }).to("mock:result");
            }
        });
        context.start();
View Full Code Here

    public void testEager() throws Exception {
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                final IdempotentRepository repo = MemoryIdempotentRepository.memoryIdempotentRepository(200);

                from("direct:start").idempotentConsumer(header("messageId"), repo).eager(true).
                        process(new Processor() {
                            public void process(Exchange exchange) throws Exception {
                                String id = exchange.getIn().getHeader("messageId", String.class);
                                // should contain
                                assertTrue("Should eager add to repo", repo.contains(id));
                            }
                        }).to("mock:result");
            }
        });
        context.start();
View Full Code Here

    }

    @Override
    public Processor createProcessor(RouteContext routeContext) throws Exception {
        Processor childProcessor = routeContext.createProcessor(this);
        IdempotentRepository idempotentRepository = resolveMessageIdRepository(routeContext);
        return new IdempotentConsumer(getExpression().createExpression(routeContext), idempotentRepository,
                                      childProcessor);
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.spi.IdempotentRepository

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.