camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Müller <christian.muel...@gmail.com>
Subject Re: Custom logging of exceptions by file component
Date Wed, 03 Jul 2013 19:49:40 GMT
Check out the following links:

http://camel.apache.org/exception-clause.html
http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/processor/RedeliveryPolicy.html


Best,
Christian
-----------------

Software Integration Specialist

Apache Camel committer: https://camel.apache.org/team
V.P. Apache Camel: https://www.apache.org/foundation/
Apache Member: https://www.apache.org/foundation/members.html

https://www.linkedin.com/pub/christian-mueller/11/551/642


On Wed, Jul 3, 2013 at 3:51 PM, Nuno Santos <nfssantos@gmail.com> wrote:

> Hello everyone,
>
> I'm using the Camel File component to monitor a directory for any file
> written there and upload them to a server. Once a file is uploaded, it is
> moved to a different directory. If the upload attempt fails, the file is
> left in place and another attempt is made to upload it in the next poll
> cycle of the File component. The code looks like this:
>
> fromF("file://%s", directory)
>   .process(new Processor() {
>     @Override
>     public void process(Exchange exchange) throws Exception {
>       // try to upload to a web server. Throw exception if failed
>     });
>
> This is working fine except that whenever an upload fails, camel logs a
> message with a large stack trace. This means that every second or so the
> log
> files grow by a couple of hundreds of lines, which is not ideal. I want to
> do custom logging of this message, eg., print a single line with a short
> message for each attempt. But so far, I haven't found a way of doing this.
>
> If I add a custom error handler to the route above and mark the exception
> as
> handled, the file component thinks that everything succeeded and deletes
> the
> file. If I don't mark it as handled, the exception will still be logged by
> the file component after it rollsback. Is it possible to change the way
> that
> the File component logs these exceptions?
>
> Thank you advance
>
>
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Custom-logging-of-exceptions-by-file-component-tp5735152.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message