You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by dvd <ja...@gmail.com> on 2008/02/09 16:00:45 UTC
File Component Error handling
Hi,
I have defined following route:
exception(ValidationException.class).to("file:target/messages/invalid");
from("file:src/data?delete=true").convertBodyTo(String.class).
to("validator:schema/person.xsd").
to("file:target/messages/valid");
The validator throws an exception when an invalid message is polled from the
specified directory. It is routed correctly to the invalid target directory,
and the original message remains in the polling directory and is locked.
How can I change this behavior so that the invalid file also is deleted from
the polling directory, just like the valid messages ?
Any thoughts on this ?
Thanks.
Dirk
--
View this message in context: http://www.nabble.com/File-Component-Error-handling-tp15372041s22882p15372041.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: File Component Error handling
Posted by cmdr <sp...@yahoo.fr>.
Hi
I am interested in the answer of this question ?
How to configure this route using xml file ?
cmdr
--
View this message in context: http://www.nabble.com/File-Component-Error-handling-tp15372041s22882p16038725.html
Sent from the Camel - Users mailing list archive at Nabble.com.
RE: File Component Error handling
Posted by Drew McAuliffe <dr...@gmail.com>.
Thanks! It looks like the trouble starts around line 119 in FileConsumer. The
call to "processStrategy.commit()" (which does the file movement) never gets
called because of the way the exception handling is done.
Claus Ibsen wrote:
>
> Hi Drew
>
> I have created the JIRA ticket for tracking the bug: CAMEL-548
> https://issues.apache.org/activemq/browse/CAMEL-548
>
>
>
> Med venlig hilsen
>
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
>
> -----Original Message-----
> From: Claus Ibsen [mailto:ci@silverbullet.dk]
> Sent: 24. maj 2008 09:38
> To: camel-user@activemq.apache.org
> Subject: RE: File Component Error handling
>
> Hi Drew
>
> Is there a JIRA ticket for this? If not please raise one and I will look
> into this asap. I do think your use-case is valid and that Camel should
> support his out-of-the-box.
>
> If you could attach a small unit test sample that demonstrates the bug
> then it's super.
>
>
> Med venlig hilsen
>
> Claus Ibsen
> ......................................
> Silverbullet
> Skovsgårdsvænget 21
> 8362 Hørning
> Tlf. +45 2962 7576
> Web: www.silverbullet.dk
>
> -----Original Message-----
> From: Drew McAuliffe [mailto:drewmca@gmail.com]
> Sent: 24. maj 2008 09:35
> To: camel-user@activemq.apache.org
> Subject: Re: File Component Error handling
>
>
> Has there been any movement on this issue with the file component? It kind
> of
> kills the use of the "exception" syntax for dealing with errors on file
> consumers, doesn't it? If, for example, the file is invalid XML, it should
> be processed, it's content moved on for notification, and then deleted
> (IMHO). I can't think of any reason to leave it around after exceptions
> are
> raised, other than by using the normal process of using the
> moveNamePrefix.
> If the file has been processed and its contents routed appropriately, what
> use it keeping it locked, where it will just keep throwing errors every
> time
> the connector polls?
>
>
> davsclaus wrote:
>>
>> Hi
>>
>> Could be a missing feature of the file component. Maybe there should be
>> an
>> option such as deleteOnFailure=true.
>>
>> Some people would like the file to be deleted, others would like it to be
>> untouched etc, so there should be a parameter option to set the
>> behaviour.
>>
>> If the feature is missing, please file a JIRA so its not forgotten.
>>
>>
>>
>> dvd wrote:
>>>
>>> Hi,
>>>
>>> I have defined following route:
>>>
>>> exception(ValidationException.class).to("file:target/messages/invalid");
>>> from("file:src/data?delete=true").convertBodyTo(String.class).
>>> to("validator:schema/person.xsd").
>>> to("file:target/messages/valid");
>>>
>>> The validator throws an exception when an invalid message is polled from
>>> the specified directory. It is routed correctly to the invalid target
>>> directory, and the original message remains in the polling directory and
>>> is locked.
>>> How can I change this behavior so that the invalid file also is deleted
>>> from the polling directory, just like the valid messages ?
>>>
>>> Any thoughts on this ?
>>>
>>> Thanks.
>>> Dirk
>>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/File-Component-Error-handling-tp15372041s22882p17445214.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>
>
--
View this message in context: http://www.nabble.com/File-Component-Error-handling-tp15372041s22882p17453030.html
Sent from the Camel - Users mailing list archive at Nabble.com.
RE: File Component Error handling
Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi Drew
I have created the JIRA ticket for tracking the bug: CAMEL-548
https://issues.apache.org/activemq/browse/CAMEL-548
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Claus Ibsen [mailto:ci@silverbullet.dk]
Sent: 24. maj 2008 09:38
To: camel-user@activemq.apache.org
Subject: RE: File Component Error handling
Hi Drew
Is there a JIRA ticket for this? If not please raise one and I will look into this asap. I do think your use-case is valid and that Camel should support his out-of-the-box.
If you could attach a small unit test sample that demonstrates the bug then it's super.
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Drew McAuliffe [mailto:drewmca@gmail.com]
Sent: 24. maj 2008 09:35
To: camel-user@activemq.apache.org
Subject: Re: File Component Error handling
Has there been any movement on this issue with the file component? It kind of
kills the use of the "exception" syntax for dealing with errors on file
consumers, doesn't it? If, for example, the file is invalid XML, it should
be processed, it's content moved on for notification, and then deleted
(IMHO). I can't think of any reason to leave it around after exceptions are
raised, other than by using the normal process of using the moveNamePrefix.
If the file has been processed and its contents routed appropriately, what
use it keeping it locked, where it will just keep throwing errors every time
the connector polls?
davsclaus wrote:
>
> Hi
>
> Could be a missing feature of the file component. Maybe there should be an
> option such as deleteOnFailure=true.
>
> Some people would like the file to be deleted, others would like it to be
> untouched etc, so there should be a parameter option to set the behaviour.
>
> If the feature is missing, please file a JIRA so its not forgotten.
>
>
>
> dvd wrote:
>>
>> Hi,
>>
>> I have defined following route:
>>
>> exception(ValidationException.class).to("file:target/messages/invalid");
>> from("file:src/data?delete=true").convertBodyTo(String.class).
>> to("validator:schema/person.xsd").
>> to("file:target/messages/valid");
>>
>> The validator throws an exception when an invalid message is polled from
>> the specified directory. It is routed correctly to the invalid target
>> directory, and the original message remains in the polling directory and
>> is locked.
>> How can I change this behavior so that the invalid file also is deleted
>> from the polling directory, just like the valid messages ?
>>
>> Any thoughts on this ?
>>
>> Thanks.
>> Dirk
>>
>
>
--
View this message in context: http://www.nabble.com/File-Component-Error-handling-tp15372041s22882p17445214.html
Sent from the Camel - Users mailing list archive at Nabble.com.
RE: File Component Error handling
Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi Drew
Is there a JIRA ticket for this? If not please raise one and I will look into this asap. I do think your use-case is valid and that Camel should support his out-of-the-box.
If you could attach a small unit test sample that demonstrates the bug then it's super.
Med venlig hilsen
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Drew McAuliffe [mailto:drewmca@gmail.com]
Sent: 24. maj 2008 09:35
To: camel-user@activemq.apache.org
Subject: Re: File Component Error handling
Has there been any movement on this issue with the file component? It kind of
kills the use of the "exception" syntax for dealing with errors on file
consumers, doesn't it? If, for example, the file is invalid XML, it should
be processed, it's content moved on for notification, and then deleted
(IMHO). I can't think of any reason to leave it around after exceptions are
raised, other than by using the normal process of using the moveNamePrefix.
If the file has been processed and its contents routed appropriately, what
use it keeping it locked, where it will just keep throwing errors every time
the connector polls?
davsclaus wrote:
>
> Hi
>
> Could be a missing feature of the file component. Maybe there should be an
> option such as deleteOnFailure=true.
>
> Some people would like the file to be deleted, others would like it to be
> untouched etc, so there should be a parameter option to set the behaviour.
>
> If the feature is missing, please file a JIRA so its not forgotten.
>
>
>
> dvd wrote:
>>
>> Hi,
>>
>> I have defined following route:
>>
>> exception(ValidationException.class).to("file:target/messages/invalid");
>> from("file:src/data?delete=true").convertBodyTo(String.class).
>> to("validator:schema/person.xsd").
>> to("file:target/messages/valid");
>>
>> The validator throws an exception when an invalid message is polled from
>> the specified directory. It is routed correctly to the invalid target
>> directory, and the original message remains in the polling directory and
>> is locked.
>> How can I change this behavior so that the invalid file also is deleted
>> from the polling directory, just like the valid messages ?
>>
>> Any thoughts on this ?
>>
>> Thanks.
>> Dirk
>>
>
>
--
View this message in context: http://www.nabble.com/File-Component-Error-handling-tp15372041s22882p17445214.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: File Component Error handling
Posted by Drew McAuliffe <dr...@gmail.com>.
Has there been any movement on this issue with the file component? It kind of
kills the use of the "exception" syntax for dealing with errors on file
consumers, doesn't it? If, for example, the file is invalid XML, it should
be processed, it's content moved on for notification, and then deleted
(IMHO). I can't think of any reason to leave it around after exceptions are
raised, other than by using the normal process of using the moveNamePrefix.
If the file has been processed and its contents routed appropriately, what
use it keeping it locked, where it will just keep throwing errors every time
the connector polls?
davsclaus wrote:
>
> Hi
>
> Could be a missing feature of the file component. Maybe there should be an
> option such as deleteOnFailure=true.
>
> Some people would like the file to be deleted, others would like it to be
> untouched etc, so there should be a parameter option to set the behaviour.
>
> If the feature is missing, please file a JIRA so its not forgotten.
>
>
>
> dvd wrote:
>>
>> Hi,
>>
>> I have defined following route:
>>
>> exception(ValidationException.class).to("file:target/messages/invalid");
>> from("file:src/data?delete=true").convertBodyTo(String.class).
>> to("validator:schema/person.xsd").
>> to("file:target/messages/valid");
>>
>> The validator throws an exception when an invalid message is polled from
>> the specified directory. It is routed correctly to the invalid target
>> directory, and the original message remains in the polling directory and
>> is locked.
>> How can I change this behavior so that the invalid file also is deleted
>> from the polling directory, just like the valid messages ?
>>
>> Any thoughts on this ?
>>
>> Thanks.
>> Dirk
>>
>
>
--
View this message in context: http://www.nabble.com/File-Component-Error-handling-tp15372041s22882p17445214.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: File Component Error handling
Posted by davsclaus <ci...@yahoo.dk>.
Hi
Could be a missing feature of the file component. Maybe there should be an
option such as deleteOnFailure=true.
Some people would like the file to be deleted, others would like it to be
untouched etc, so there should be a parameter option to set the behaviour.
If the feature is missing, please file a JIRA so its not forgotten.
dvd wrote:
>
> Hi,
>
> I have defined following route:
>
> exception(ValidationException.class).to("file:target/messages/invalid");
> from("file:src/data?delete=true").convertBodyTo(String.class).
> to("validator:schema/person.xsd").
> to("file:target/messages/valid");
>
> The validator throws an exception when an invalid message is polled from
> the specified directory. It is routed correctly to the invalid target
> directory, and the original message remains in the polling directory and
> is locked.
> How can I change this behavior so that the invalid file also is deleted
> from the polling directory, just like the valid messages ?
>
> Any thoughts on this ?
>
> Thanks.
> Dirk
>
--
View this message in context: http://www.nabble.com/File-Component-Error-handling-tp15372041s22882p16046544.html
Sent from the Camel - Users mailing list archive at Nabble.com.