You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Himanshu Mittal <hi...@gmail.com> on 2014/11/24 09:34:28 UTC
Issue in FILE consumer URI having startingDirectoryMustExist set to
true
Hi,
I am observing one strange behavior with consumer route in camel FILE
component
Here is how I am configuring my camel route
public void configure() throws Exception {
onException(Exception.class)
.handled(true)
.to(ERROR_HANDLER);
from(camelURI).routeId(routeID).noAutoStartup()
.doTry()
.process(iTask)
.to(CONSUMER_TASK)
.doCatch(Exception.class)
.to(ERROR_HANDLER)
.end();
}
In case when polling directory ( "C:/camel/temp" )does not exist I am not
able to handle the exception with camel URI configuration.
It comes to ERROR_HANDLER when camelURI params are configured as :
file://C:/camel/temp?
&delay=10&useFixedDelay=true&initialDelay=10*&startingDirectoryMustExist=true*&consumer.bridgeErrorHandler=true&autoCreate=false*&startingDirectoryMustExist=true*&directoryMustExist=true&readLock=changed
BUT does not come to error handler when camelURI params are configured as
1)file://C:/camel/temp?&delay=10&useFixedDelay=true&initialDelay=10&consumer.bridgeErrorHandler=true&autoCreate=false*&startingDirectoryMustExist=true*&directoryMustExist=true&readLock=changed
2)file://C:/camel/temp?&delay=10&useFixedDelay=true&initialDelay=10*&startingDirectoryMustExist=true*
&consumer.bridgeErrorHandler=true&autoCreate=false
&directoryMustExist=true&readLock=changed
3)file://C:/camel/temp?&delay=10&useFixedDelay=true&initialDelay=10*&startingDirectoryMustExist=true*&autoCreate=false
&directoryMustExist=true &consumer.bridgeErrorHandler=true &readLock=changed
I am not able to figure out the route cause how is the positioning of
*startingDirectoryMustExist *affecting the camel route ?
--
View this message in context: http://camel.465427.n5.nabble.com/Issue-in-FILE-consumer-URI-having-startingDirectoryMustExist-set-to-true-tp5759521.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Issue in FILE consumer URI having
startingDirectoryMustExist set to true
Posted by Willem Jiang <wi...@gmail.com>.
It’s strange your uri is options is start with “?&”. You can double check with it?
BTW, I just added a unit test[1] to file endpoint, it look like startingDirectoryMustExist option workd rightly.
[1]https://git-wip-us.apache.org/repos/asf?p=camel.git;a=commit;h=3697fbc9
--
Willem Jiang
Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang
Weibo: 姜宁willem
On November 24, 2014 at 4:35:28 PM, Himanshu Mittal (himanshu.mittal313@gmail.com) wrote:
> Hi,
> I am observing one strange behavior with consumer route in camel FILE
> component
>
> Here is how I am configuring my camel route
>
> public void configure() throws Exception {
> onException(Exception.class)
> .handled(true)
> .to(ERROR_HANDLER);
>
> from(camelURI).routeId(routeID).noAutoStartup()
> .doTry()
> .process(iTask)
> .to(CONSUMER_TASK)
> .doCatch(Exception.class)
> .to(ERROR_HANDLER)
> .end();
> }
>
>
> In case when polling directory ( "C:/camel/temp" )does not exist I am not
> able to handle the exception with camel URI configuration.
> It comes to ERROR_HANDLER when camelURI params are configured as :
> file://C:/camel/temp?
> &delay=10&useFixedDelay=true&initialDelay=10*&startingDirectoryMustExist=true*&consumer.bridgeErrorHandler=true&autoCreate=false*&startingDirectoryMustExist=true*&directoryMustExist=true&readLock=changed
>
> BUT does not come to error handler when camelURI params are configured as
> 1)file://C:/camel/temp?&delay=10&useFixedDelay=true&initialDelay=10&consumer.bridgeErrorHandler=true&autoCreate=false*&startingDirectoryMustExist=true*&directoryMustExist=true&readLock=changed
>
> 2)file://C:/camel/temp?&delay=10&useFixedDelay=true&initialDelay=10*&startingDirectoryMustExist=true*
> &consumer.bridgeErrorHandler=true&autoCreate=false
> &directoryMustExist=true&readLock=changed
>
> 3)file://C:/camel/temp?&delay=10&useFixedDelay=true&initialDelay=10*&startingDirectoryMustExist=true*&autoCreate=false
> &directoryMustExist=true &consumer.bridgeErrorHandler=true &readLock=changed
>
> I am not able to figure out the route cause how is the positioning of
> *startingDirectoryMustExist *affecting the camel route ?
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Issue-in-FILE-consumer-URI-having-startingDirectoryMustExist-set-to-true-tp5759521.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>