camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raul <ludala...@gmail.com>
Subject Re: ExceptionHandler in a ftp Route
Date Tue, 07 Feb 2012 17:27:57 GMT
Hello again Babak,

I have got to associate own custom ExceptionHandler to the Consumer of my
FTP Route. But I continue to have problems to control
"renaming/moving/deleting" of FTP.

I have followed the code and the problem is that the ExceptionHandler of
the Consumer is diferente of GenericFileOnCompletion.

During the execution of FTP route is invoked the method
*processExchange*of the class
* GenericFileConsumer<T> *then a "OnCompletion" is added of this way:

*exchange.addOnCompletion(new GenericFileOnCompletion<T>(endpoint,
operations, target, absoluteFileName));*

The exceptionHandler of this GenericFileOnCompletion is null, I belived
that it used the exceptionHandler of the Consumer. And like you indicated
me, if exceptionHandler is null then the LoggingExceptionHandler is used.

The key is  to change the ExceptionHandler of  GenericFileOnCompletion but
I don't know how do it.

I have reread your advice and I have some doubt. First you say:

" If you want to react differently on an encountered exception you can
inject your own custom ExceptionHandler (for example into a FileConsumer)"

I think like this class uses "new" is not possible inject the my
ExceptionHandler to the GenericFileOnCompletion. Is it?

On the other hand, you indicated me that other solution would be:

 "provide your own Synchronization implementation and do:

exchange.addOnCompletion(MyHandler)

For example from inside a Processor inside your route"

In this case,  will MyHandler be a simple class that implements
Synchonization?

How  can I control with MyHandler the Exceptions of the "other"
addOnCompletion? I mean, the Exceptions don't control of the "other"
addOnCompletion are the problems during the "renaming/moving/deleting"

Thank you again.


--
View this message in context: http://camel.465427.n5.nabble.com/ExceptionHandler-in-a-ftp-Route-tp5451466p5463890.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message