Saturday, May 26, 2012

The FTP MOVE operation with a JCA FTP Adapter

the difference between the case with RNFR-RNTO and the case of COPY/DELETE. The difference is simpls using

UseNativeRenameOperation = "true"
UseFtpRenameOperation = "true"

in the dynamic JCA properties of the Business Service built on top the JCA FTPAdapter


THIS IS THE GOOD CASE, with
UseNativeRenameOperation = "true"
UseFtpRenameOperation = "true"


the MOVE is done with a RNFR-RNTO:

[ INFO] 2012-05-25 23:41:17,664 [myuser] [10.19.10.100] RECEIVED: RNFR /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml
[ INFO] 2012-05-25 23:41:17,665 [myuser] [10.19.10.100] SENT: 350 Requested file action pending further information.

[ INFO] 2012-05-25 23:41:17,666 [myuser] [10.19.10.100] RECEIVED: RNTO /myuser/environments/env-0/ave/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml
[ INFO] 2012-05-25 23:41:17,667 [myuser] [10.19.10.100] File rename from "/myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml" to "/myuser/environments/env-0/ave/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982077267PO_FFMW_AVE_1337982077267.xml"
[ INFO] 2012-05-25 23:41:17,668 [myuser] [10.19.10.100] SENT: 250 Requested file action okay, file renamed.


THIS IS THE BAD CASE, without using the "UseNative" options: the move is done by RETRIEVING locally the file, COPYING it to destination and DELETING the remote source:


[ INFO] 2012-05-25 23:47:17,806 [myuser] [10.19.10.100] RECEIVED: RETR /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,807 [myuser] [10.19.10.100] File downloaded /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ WARN] 2012-05-25 23:47:17,808 [myuser] [10.19.10.100] Releasing unreserved passive port: 54862
[ INFO] 2012-05-25 23:47:17,808 [myuser] [10.19.10.100] SENT: 150 File status okay; about to open data connection.

[ INFO] 2012-05-25 23:47:17,808 [myuser] [10.19.10.100] SENT: 226 Transfer complete.

[ INFO] 2012-05-25 23:47:17,847 [myuser] [10.19.10.100] RECEIVED: PWD
[ INFO] 2012-05-25 23:47:17,848 [myuser] [10.19.10.100] SENT: 257 "/" is current directory.

[ INFO] 2012-05-25 23:47:17,848 [myuser] [10.19.10.100] RECEIVED: TYPE I
[ INFO] 2012-05-25 23:47:17,849 [myuser] [10.19.10.100] SENT: 200 Command TYPE okay.

[ INFO] 2012-05-25 23:47:17,849 [myuser] [10.19.10.100] RECEIVED: PWD
[ INFO] 2012-05-25 23:47:17,850 [myuser] [10.19.10.100] SENT: 257 "/" is current directory.

[ INFO] 2012-05-25 23:47:17,850 [myuser] [10.19.10.100] RECEIVED: CWD /myuser/environments/env-0/ave
[ INFO] 2012-05-25 23:47:17,851 [myuser] [10.19.10.100] SENT: 250 Directory changed to /myuser/environments/env-0/ave

[ INFO] 2012-05-25 23:47:17,851 [myuser] [10.19.10.100] RECEIVED: PASV
[ INFO] 2012-05-25 23:47:17,852 [myuser] [10.19.10.100] SENT: 227 Entering Passive Mode (10,56,5,192,234,152)

[ INFO] 2012-05-25 23:47:17,852 [myuser] [10.19.10.100] RECEIVED: STOR POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,853 [myuser] [10.19.10.100] File uploaded /myuser/environments/env-0/ave/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ WARN] 2012-05-25 23:47:17,853 [myuser] [10.19.10.100] Releasing unreserved passive port: 60056
[ INFO] 2012-05-25 23:47:17,853 [myuser] [10.19.10.100] SENT: 150 File status okay; about to open data connection.

[ INFO] 2012-05-25 23:47:17,854 [myuser] [10.19.10.100] SENT: 226 Transfer complete.

[ INFO] 2012-05-25 23:47:17,894 [myuser] [10.19.10.100] RECEIVED: CWD /
[ INFO] 2012-05-25 23:47:17,895 [myuser] [10.19.10.100] SENT: 250 Directory changed to /

[ INFO] 2012-05-25 23:47:17,896 [myuser] [10.19.10.100] RECEIVED: PWD
[ INFO] 2012-05-25 23:47:17,897 [myuser] [10.19.10.100] SENT: 257 "/" is current directory.

[ INFO] 2012-05-25 23:47:17,898 [myuser] [10.19.10.100] RECEIVED: DELE /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,899 [myuser] [10.19.10.100] File delete : myuser - /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml
[ INFO] 2012-05-25 23:47:17,899 [myuser] [10.19.10.100] SENT: 250 Requested file action okay, deleted /myuser/environments/env-0/ave/tmp/POCREATE^PuO20111212_164122_1640.txt^AVE^1337982437334PO_FFMW_AVE_1337982437334.xml.





note: those options are totally undocumented

you need to add this

<jca:dynamic-endpoint-properties>
        <jca:endpoint-property>
          <jca:name>UseNativeRenameOperation</jca:name>
          <jca:value>true</jca:value>
        </jca:endpoint-property>
        <jca:endpoint-property>
          <jca:name>UseFtpRenameOperation</jca:name>
          <jca:value>true</jca:value>
        </jca:endpoint-property>
      </jca:dynamic-endpoint-properties>

in your BS at the end of the tran:provider-specific section


These events are visible also in the WLS logs if you enable java:alsb-jca-framework-adapter-debug in alsbdebug.xml

No comments: