Hi Read the java doc on the consumer template http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/ConsumerTemplate.html
You need to done the UoW on the exchange when using the receive method. On Thu, Mar 8, 2012 at 4:42 PM, Craig Taylor <[email protected]> wrote: > Using 2.8, I'm polling an error directory and am wanting to validate that > the original source file exists before displaying prompts to the end user > to reprocess it. I'm having an issue in that my directory routine is > leaving stray .camelLock files behind. > > I've looked into the options on file and don't see any obvious options on > how to disable the .camelLock references. This is causing an issue when > I'm trying to move the source files after obtaining the directory (files > are no long visible because of the camelLocks). > > Note: Uri in this situation will change based upon user input. > > -snip- > uri += "&noop=true&lock=false"; > uri.replace("&delay=[0-9]*", "&delay=10"); // shorten delay significantly. > // Start consumption and receiving from the endpoint. > Exchange pollFileExchange = consumerTemplate.receive(uri, 1000); > /* > * A null exchange indicates no more messages. Note that we're > asssuming that > *the ftp and file components are able to poll all of the files > at one time. > */ > while (pollFileExchange != null) > { > GenericFile fileEntry = > pollFileExchange.getIn().getBody(GenericFile.class); > filenames.add(fileEntry.getFileName()); > pollFileExchange = consumerTemplate.receive(uri, 1000); > } > camelContext.removeEndpoints(uri); > -snip- > > Thanks, > > > -- > ------------------------------------------- > Craig Taylor > [email protected] -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/
