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.

Reply via email to