Harm Verhagen wrote:
> Ruwan wrote
>   
>> 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.
>>     
> Thats unfortunate. I guess thats what typically would be expected from
> a file reader component.
>
>   
>> 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.
>>     
> Is there a way to access the actual filename beeing processed in a
> sequence? (then a custom mediator could do the file moving).
>   
Yes you could write a custom mediator to do that and put the custom
mediator on the onError sequence, you could access the file name which
is being processing by using the following code fragment within a mediator;

String fileName = ((Map)
msgCtx.getProperty(MessageContext.TRANSPORT_HEADERS)).get(VFSConstants.FILE_NAME).toString();

Hope this will help you.

Thanks,
Ruwan
> 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