camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: CamelLock file being created and not sure why
Date Sun, 01 Dec 2013 07:37:44 GMT
You should not need to call the UoW done manually. Just remove that
and let Camel handle that internally.

What version of Camel do you use?
And where is the .camelLock file placed? In what directory?

And as usual try upgrade your Camel to see if this helps.

On Sun, Dec 1, 2013 at 2:14 AM, richie.riviere@gmail.com
<richie.riviere@gmail.com> wrote:
> Hi,
>
> I have a route that grabs files from an input directory, does some
> operations and then moves files to another directory.
>
> The route works well and my file is moved post processing. My issue is that
> a camelLock file gets left in the source directory after processing. I read
> somewhere in the camel forums that you need to set the unit of work is done
> to complete this and I've tried this (see route below where I add a
> processor after the last operation in my route) but it didn't work and it
> didn't make sense to do that either.
>
> Can anyone help me out please.
>
> thanks
>
> Here is what the route looks like.
>
>         from("file:src/inbox/items/?preMove=processed&move=done")
>                         .process(new Processor() {
>                             public void process(Exchange exchange) throws Exception {
>                                 String filename = (String)
> exchange.getIn().getHeader(CamelConstants.HEADER_KEY_CAMEL_FILE_NAME);
>                                 String body = exchange.getIn().getBody(String.class);
>                                 ImportPayloadEntity importPayloadEntity = new
> ImportPayloadEntity();
>                                 importPayloadEntity.setPayloadType(DaoConstants.ITEM_PAYLOAD);
>                                 importPayloadEntity.setPayloadBody(body);
>                                 importPayloadEntity.setFilename(filename);
>                                 importPayloadEntity.setLoadDateTime(new Date());
>                                 importPayloadEntity.setProcessedInd(DaoConstants.NOT_PROCESSED);
>                                 importPayloadEntity.setProcessedDatetime(null);
>
> exchange.getIn().setHeader(CamelConstants.HEADER_KEY_IMPORT_PAYLOAD,
> importPayloadEntity);
>                             }
>                         })
>             .convertBodyTo(
>                         ItemDocument.class)
>                         .to("jpa:org.apache.camel.etl.entity.ImportPayloadEntity")
>                         .process(new Processor() {
>                             public void process(Exchange exchange) throws Exception {
>                                 exchange.getUnitOfWork().done(exchange);
>                             }
>                         });
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/CamelLock-file-being-created-and-not-sure-why-tp5744115.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Mime
View raw message