camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Samuelsson <>
Subject catch Exception thrown by ScheduledPollConsumer
Date Fri, 04 Mar 2011 13:42:58 GMT
Scenario: We have built a custom samba-component backed by jcifs that
extends GenericFileComponent. The Consumer extends GenericFileConsumer,
meaning it's also a ScheduledPollConsumer. The Consumer is in this case
using a custom Strategy that extends DefaultPollingConsumerPollStrategy. The
Strategy's rollback-method will under some circumstances throw an Exception
(e.g. when the share is unavailable or the provided credentials are

The RouteBuilder's configure-method looks something like this:

public void configure() {
    errorHandler(loggingErrorHandler("Handling FAILED"));

            .log(LoggingLevel.INFO, "Caught an exception.");

                .log(LoggingLevel.INFO, "Processing ${file:name}...")

Question: How can we handle this Exception?  We need a way to "catch" this
Exception and invoke another route (at this time to produce some custom
logging). The above code doesn't produce anything in the log. I believe this
have something to do with the Exception being thrown before the Exchange is

Thanks in advance,


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message