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: how can I do this?
Date Thu, 02 Feb 2012 16:34:57 GMT
Hi

You can use a direct endpoint as the DLC

errorHandler(deadLetterChannel("direct:myDLC"));

And then a route where you write the error file, and then afterwards
the original file.

from(file:inbox?delete=true)
   ....



from("direct:myDLC")
   .bean(new WriteErrorFileBean());
   .to("file:error");


public class WriteErroBean {

   public void writeErrorReport(File file, Exception cause,
CamelContext context) {
     ... write a error file based on the error message
     .. you can use a camel producer template to save the file, but of
course use Java File API also works
   }

}



On Thu, Feb 2, 2012 at 5:28 PM, cbuxbaum
<cbuxbaum@tradestonesoftware.com> wrote:
> Hello,
>
> I have a route that takes a file from one location and processes it to
> another.  On Exception, I would like to have the file deposited in a
> deadletter location (note, a location, not a queue).  So I have that feature
> working, but additionally, I would like to retrieve the exception from the
> exchange, and create a log file next to the file in the dead letter
> location, something like,
>
> Demo1.ai
> Demo1.ai.error.log
>
> There does not seem to be any way to intercept the dead letter processing
> just before or after moving to the dead letter queue in order to create the
> log file.  I can think of other ways of doing this, but I like the retry
> feature of the deadletter channel, and just want to add some processing to
> the end.
>
> Thanks,
>
> Carl
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/how-can-I-do-this-tp5451194p5451194.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
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