Hi Ah I took a look at your code and of course you have a catch-22 situation.
You consume a file and want it as a File instance (which is just a handle for a file). and then you want that file deleted. This means your file handle would point to a deleted file. What you could do is to return the file as a String which means the content of the file is read into memory. Then Camel could delete the file. On Fri, Aug 20, 2010 at 4:15 PM, Andreas Asmuss <andreasasm...@gmail.com> wrote: > > Hi > > I have a route where I call this bean. The consumer gets the file and > everything is OK except the file is not deleted. There is also a .camelLock > file which is left behind at every run. So isn't the consumer finishing up, > or what could be wrong? > > public class CustomEnricher { > public void enrich(Message m, @XPath("/root/rsp/text()") String path, > CamelContext ctx) { > ConsumerTemplate consumer = ctx.createConsumerTemplate(); > File file = > consumer.receiveBody("file:data?delete=true&fileName=" + path, > File.class); > m.setHeader("newFileName", file.getName()); > m.setBody(file); > } > } > -- > View this message in context: > http://camel.465427.n5.nabble.com/ConsumerTemplate-not-finishing-tp2642233p2642233.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen Apache Camel Committer Author of Camel in Action: http://www.manning.com/ibsen/ Open Source Integration: http://fusesource.com Blog: http://davsclaus.blogspot.com/ Twitter: http://twitter.com/davsclaus