Hi Harm,

Sorry for the delay in responding. I was busy with some other work.

See my comments below;

Harm Verhagen wrote:
>> Fault mediator make the message in hand s fault message, it doesn't
>> trigger a fault to the transport. You can try writing a custom mediator
>> and throwing a SynapseException at the mediate method. I am afraid there
>> is no way that you can fault a sequence in the standard configuration,
>> not sure whether that is good or not after looking at your requirement. :-)
>>
>>     
>
> I tried writing  a custom mediator :
> Unfortunately it doesn't work.  Throwing a SynapseException does not
> trigger the VFS to move the file to the error folder.
> It still happyly moves my file to the transport.vfs.MoveAfterProcess.
>
> mediator snippet:
> public boolean mediate(MessageContext messageContext) {
>               if (log.isDebugEnabled())
>                       log.debug("FaultMediator.mediate()");
>               
>               log.error("FaultMediator invoking fault, message = " + message 
> + " ,
> message2 = ");
>
>             throw new SynapseException("Faulting: " + message + ", " + 
> message2);
> }
>
>
> I get the folling loggin.
> [2009-09-02 12:05:16,010] DEBUG - VFSTransportListener Processing file
> :file:///c:/dir/Incoming/inbox/S_USERDATA_20090713_093939_000008.xml
> [2009-09-02 12:05:16,026]  INFO - LogMediator To: ,MessageID:
> urn:uuid:F9C82012783CAD548C1251885917857,Directi
> on: request
> [2009-09-02 12:05:16,041] ERROR - FaultMediator FaultMediator invoking
> fault, message = txt , message2 =
> [2009-09-02 12:05:16,041] DEBUG - VFSTransportListener Processed file
> : file:///c:/dir/Incoming/inbox/S_USERDATA_20090713_093939_000008.xml
> of Content-type : application/xml
> [2009-09-02 12:05:16,041] DEBUG - VFSTransportListener Moving to file
> :file:///c:/dir/Incoming/processed/S_USERDATA_20090713_093939_000008.xml
>
>
> Besides this problem, an exception not caused by a custom mediator,
> also doesn't make the VFS move the file to the
> transport.vfs.MoveAfterFailure|MoveAfterErrors directory.
> for example: when server in the URL of a call-out sequence is down,
> you get an exception (as expected). However the VFS still moves the
> file happily to the transport.vfs.MoveAfterProcess folder.
>   
I went through the code and realized that the mediation cannot trigger
any of those :-(, the fact that the transports are asynchronous makes it
bit hard to trigger the errors from the mediation to the transport
listener error flow. That is because the transport listener is operating
with a separate thread pool and gives the control to the worker pool
once it is read, and worker pool handles the mediation.

Because of that the above configurations applies only for the transport
level failures (basically I/O errors when reading the file or any issues
related to loading the file into the environment)
> Question: how to trigger the VFS to move a message. (After the VFS
> itself has successfully read the file) to the
> MoveAfterErrors|MoveAfterFailure folder.
>   
There is no way at least for the moment, without some configuration to
do it at the configuration it self. For example you may setup an onError
sequence to send the file to location specified in the MoveAfterErrors
location by using a VFS endpoint.
> side question: when will MoveAfterFailure be used, and when MoveAfterErrors ?
>   
Well, MoveAfterErrors seem to be obsolete and not in use
MoveAfterFailure occurs when there is an file read/load errors.

Thanks,
Ruwan
>
> version: ESB v2.1
>
> Regards,
> Harm
>
> _______________________________________________
> Esb-java-user mailing list
> [email protected]
> https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user
>
>   


-- 
Ruwan Linton
Technical Lead & Product Manager; WSO2 ESB; http://wso2.org/esb
WSO2 Inc.; http://wso2.org
email: [email protected]; cell: +94 77 341 3097
blog: http://blog.ruwan.org



_______________________________________________
Esb-java-user mailing list
[email protected]
https://wso2.org/cgi-bin/mailman/listinfo/esb-java-user

Reply via email to