camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bengt Rodehav <be...@rodehav.com>
Subject errorHandler in combination with move and moveFailed
Date Tue, 22 Jun 2010 09:34:29 GMT
I'm doing a lot of file transfer from and to different destinations using
file/ftp/ftps/sftp. I use the "move" and "moveFailed" options to archive
succesfully handled files in one directory and failed files in another
directory.This works fine without the need for any specific error handler.

However, I now want to use an error handler to:

- Customise the redelivery options
- Notify a system administrator that a file transfer has failed so that
recovery actions can be initiated

It seems to be very difficult to combine these two aspects. One way is to
declare an error handler and then mark the exchange as "handled(false)" as
follows:

  errorHandler(defaultErrorHandler().maximumRedeliveries(10).delayPattern("...").handled(false));

However, the "handled" option seems to be deprecated. I read the following
conversation:

http://www.mail-archive.com/users@camel.apache.org/msg08254.html

It seems like the idea is that if an error handler is used, then it should
always handle the error (sounds logical considering it's called "error
handler"). What I don't understand then is how I can combine the
"move/moveFailed" options with an error handler for redelivery purposes AND
the ability to perform additional actions (notifying by some means). The
latter would be solved perfectly if I could direct the error handler to an
arbitrary route but I think that can only be done in "onException".

Anyone have any suggestions?

/Bengt

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