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();