Hi again babak,
I have made my own Synchronization and I have added it at the begin of my
Process.
During the debug I could observe there were both Synchronizations:
- MySynchronization
- The Synchronization of GenericFileOnCompletion
I am using in my ftp route the option "move=.done", but to produce
Exceptions the ftp user have not authorization to move files.
All the code of myProcess is executed completely. Then it begin to process
the Synchonization of mine and next the synchronization of
GenericFileOnCompletion.
In both case, despite of the user haven't got autorization, the method
OnComplete() is executed instead of onFailure(). Perhaps it's ok because all
the code of myProcess is completed. But the processStrategy.commit() throw
an exception because it haven't autorization to "move" the file.
Actually mSynchronization is empty, only System.out.println... to confir
that the code is execute.
The important code, the code that really "move" the file continue been the
synchronization of GenericFileOnCompletion, but I don't see the way to
change the ExceptionHandler to catch the exception.
The GenericFileOnCompletion has a method to change the ExceptionHandler,
/public void setExceptionHandler(ExceptionHandler exceptionHandler)/ but I
don't get to access to it since the exchange of myProcess. I see it in the
debug in the UnitOfWork, but I don't know get back the
GenericFileOnCompletion and change the ExceptionHandle. Perhaps isn't
possible because the methods are private and protect
I have thought make a Synchronization extending the class of
GenericFileOnCompletion because I really need is execute its code (to move,
delete, rename the file). This idea has 2 problems at least.
1) How get the parameter of this class since the myProcess. The constructor
is:
/public GenericFileOnCompletion(GenericFileEndpoint<T> endpoint,
GenericFileOperations<T> operations,
GenericFile<T> file, String
absoluteFileName)/
2) I would need remove the orgininal GenericFileOnCompletion because
otherwise, both Synchronizations will try to move the file and like the
first point perhaps isn't possible.
I believe that this problem is very common. The FTP server can shutdown in
middle of the Process. problems with authorizations, problem with quotas of
disk, etc. In all this case the Process will finished ok, and the problem
will be to "move, delete or rename". And I imagine that everbody wants to
control this situations, not only writing in the log.
Thank you for all, Babak
Raúl.
--
View this message in context:
http://camel.465427.n5.nabble.com/ExceptionHandler-in-a-ftp-Route-tp5451466p5467147.html
Sent from the Camel - Users mailing list archive at Nabble.com.