Hi Can you try set removeOnFailure=false on the idempotent consumer http://camel.apache.org/idempotent-consumer.html
On Thu, Feb 5, 2015 at 11:57 AM, geppo <[email protected]> wrote: > Hi, I have a route with a File idempotent repository and an errorHandler. > > When a specific file causes an error I want it to be added to the idempotent > repository so it doesn't get processed again. Any idea how to do it? > > With the code below, the corrupted file is not added to the idempotent > repository so it gets reprocessed every time I restarted my application. > Also, how do I print the name of the inbound file in the errorHandler. I've > tried .log(${file:name}), but it doesn't work. > Thank you! > > errorHandler(deadLetterChannel(failedUri) > > .maximumRedeliveries(Integer.parseInt(errorHandlerOpt[0])) > > .logRetryStackTrace(Boolean.parseBoolean(errorHandlerOpt[3])) > .log("${file:name}") > ); > > IdempotentRepository<String> idempotentRepository = > FileIdempotentRepository > .fileIdempotentRepository(idempotentStore, 4015, > Long.MAX_VALUE); > > from(inboundUri) > .transacted() > .routeId(ROUTE_ID) > .log("Starting " + ROUTE_ID + " for file: ${file:name}") > .idempotentConsumer(simple("${file:name}"), > idempotentRepository) > .to(outboundUri); > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Idempotent-and-errorHandler-tp5762408.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
