Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

ScheduledPollConsumer Options

The ScheduledPollConsumer supports the following options:

Option

Description

pollStrategy

Camel 2.0: A pluggable org.apache.camel.PollingConsumerPollStrategy allowing you to provide your custom implementation to control error handling usually occurred during the poll operation before an Exchange have been created and being routed in Camel. In other words the error occurred while the polling was gathering information, for instance access to a file network failed so Camel cannot access it to scan for files. The default implementation will log the caused exception at WARN level and ignore it.

About error handling and scheduled polling consumers

ScheduledPollConsumer is scheduled based and its run method is invoked periodically based on schedule settings. But errors can also occur when a poll being executed. For instance if Camel should poll a file network, and this network resource is not available then a java.io.IOException could occur. As this error happens before any Exchange has been created and prepared for routing, then the regular Error Handlinghandling in Camel does not apply. So what does the consumer do then? Well the exception is propagated back to the run method where its handled. Camel will by default log the exception at WARN level and then ignore it. At next schedule the error could have been resolved and thus being able to poll the endpoint successfully.

...

Code Block
    from("file://inbox/?pollStrategy=#myPoll").to("activemq:queue:inbox")

...

Include Page
CAMEL:Using This Pattern
CAMEL:Using This Pattern

...