camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brbornia <>
Subject Re: File2 endpoint issue
Date Wed, 18 Apr 2012 22:48:06 GMT
Dam, too early to say I´m done... :(

Requirerment changed, and now I have a new issue. I needed to change the
polling interval from delay property to a quartz job like this:

<bean class="org.apache.camel.routepolicy.quartz.CronScheduledRoutePolicy"
	<property name="routeStartTime" value="* 0 1 * * ?"/>

<bean id="customPollStrategy"

<camel:route autoStartup="false" routePolicyRef="startPolicy">
	<from uri="file:/my/dir?pollStrategy=#customPollStrategy"/>

The problem I am facing now is that my quartz job is ignored after the first
execution, and the execution interval is changed to the default of the file

Here is my poll strategy class:

public class CustomPollingConsumerPollStrategy implements

	public boolean begin(Consumer consumer, Endpoint endpoint) {
		return true;

	public void commit(Consumer consumer, Endpoint endpoint, int
filesProcessed) {
		if(filesProcessed == 0){
			throw new RuntimeException("The file was not received in the expected
date and time");

	public boolean rollback(Consumer consumer, Endpoint consumerEndopint, int
retryCounter,	Exception exception) throws Exception {
		Map<String, Object> headers = new HashMap<String, Object>();
		headers.put("customHeader", "customHeader");
		CamelContext context = new DefaultCamelContext();
		ProducerTemplate template = context.createProducerTemplate();
		template.sendBodyAndHeaders("vm:failure", exception.getMessage(),
		return false;

What am I missing now?

Thanks again,

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message