I have done this before, it may take me a bit to find the code. I think you accomplish it by doing the following:
1. Override the from(String) method in RouteBuilder 2. Use getContext().getEndpoint(uri) to get the endpoint, if the endpoint is not a scheduledpollingendpoint then do super.from(uri) otherwise continue 3. create a wrapping endpoint and wrapping consumer to wrap a scheduled endpoint and a scheduled polling consumer - for the doStart method of the wrapping consumer call wrappedConsumer.run(), this will do only one poll and the doStart will not end till the poll is done 4. return super.from(wrappedEndpoint) in the overridden method If I remember right, I think there are some issues if the wrapped consumer is a RemoteFileConsumer, but this works pretty well. I will try to put this together in a groovy class soon to help you out. On Mon, Jul 2, 2012 at 10:17 AM, raphael <[email protected]>wrote: > OK, it's working by transforming the body in File(filename). > > But in that scenario, I lost all the features of the file component, right > ? > (like move option for example). > > -- > View this message in context: > http://camel.465427.n5.nabble.com/File-consumer-event-based-not-polling-tp5715349p5715355.html > Sent from the Camel - Users mailing list archive at Nabble.com. >
