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: camel-file : Avoiding CamelLock...
Date Thu, 08 Mar 2012 16:39:46 GMT
On Thu, Mar 8, 2012 at 5:32 PM, Craig Taylor <ctalkobt@ctalkobt.net> wrote:
> Thanks Claus,
>
> That was the problem... I had initially had it but removed it due to the
> files disappearing as I didn't have the right options set.
>
> As an aside,
>
> Are there any utilities or 3rd party apis to confure Camel uri's more
> easily? Eg: CamelUri cUri = new CamelUri(string);  cUri.setParam("noop",
> "true") etc?
>

See IntrospectionSupport
it allows to set options on a bean from a map etc.

This is what the Camel components uses to set properties from endpoint uris

>
> On Thu, Mar 8, 2012 at 11:04 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
>
>> 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 <ctalkobt@ctalkobt.net>
>> 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
>> > ctalkobt@ctalkobt.net
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> FuseSource
>> Email: cibsen@fusesource.com
>> Web: http://fusesource.com
>> Twitter: davsclaus, fusenews
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/
>>
>
>
>
> --
> -------------------------------------------
> Craig Taylor
> ctalkobt@ctalkobt.net



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message