2

I'm facing a little issue on WSO2 VFS system. I have a simple inbound-endpoint that scan a folder every 5 seconds to read a CVS file. I want to handle the case where the filename is not the expected one. I managed that with an error sequence but still I got a technical error:

ERROR - FilePollingConsumer Error moving file : file:///C:/Servers/Flux/Input/UESMGEN_2AAB_20160729.csv to file:///C:/Servers/Flux/Output/Process/ org.apache.commons.vfs2.FileSystemException: Could not rename "

I used the transport.vfs.MoveAfterFailure but the file is moved to the transport.vfs.MoveAfterProcess path. I assume this is due to the technical error.

But when I test my sequence with a correct file, everything goes well.

Any thoughts on this ? Thanks for your help

Community
  • 1
  • 1
Julien GRESSE
  • 354
  • 1
  • 13

2 Answers2

5

transport.vfs.MoveAfterFailure is used before the mediation, when an error occurs in the transport layer / in flow of axis2 (for exemple, when building an application/xml message where some end tags are missing).

As soon as the message comes in your mediation, even if a fault sequence is executed, transport.vfs.MoveAfterProcess will be used

(this is the way it works with ESB 4.8.1, cannot say this is still the same with ESB 5)

Jean-Michel
  • 5,926
  • 1
  • 13
  • 19
0

Thanks for this precision Jean-Michel. Sorry for re-opening the issue, but I feel that I won't find much occasion to have an answer as clear as the one you delivered.

Is it possible for the mediation to move the file from transport.vfs.MoveAfterProcess (where it was moved by the transport layer) to an other folder in case some issue occurs? Here is the relevant part of an error sequence where I try to move the file

  • from sftp://foo:***@localhost:2222/Process
  • to sftp://foo:***@localhost:2222/Errors
<fileconnector.move>
    <source>{fn:concat($ctx:rsaFolderProcess ,$trp:FILE_NAME)}</source>
    <destination>{fn:concat($ctx:rsaFolderErrors,$trp:FILE_NAME)}</destination>
</fileconnector.move>

(I am using the file-connector 2.0.20 and rsaFolderProcess and rsaFolderErrors have been defined)

This leads to the following error:

[2020-03-26 14:51:21,743] [] ERROR - FileMove Unable to move a file/folder.
org.apache.commons.vfs2.FileSystemException: Could not determine if file "sftp://foo:***@localhost:2222/Process" is writeable.
        at org.apache.commons.vfs2.provider.AbstractFileObject.isWriteable(AbstractFileObject.java:1529)
        at org.apache.commons.vfs2.provider.AbstractFileObject.moveTo(AbstractFileObject.java:1573)
        at org.wso2.carbon.connector.FileMove.fileMove(FileMove.java:143)
        at org.wso2.carbon.connector.FileMove.moveFile(FileMove.java:103)
        at org.wso2.carbon.connector.FileMove.connect(FileMove.java:60)
.....

I checked the rights. The user foo can write in Success and /Errors; the only problem being that the mediation sequence does not know that and is unable to move a file from the former to the latter. It is as if the rights declared in the transport layer were not inherited by mediations. How to fix this and achieve this goal?

Environment

  • wso2ei 6.5.0
zar3bski
  • 2,773
  • 7
  • 25
  • 58