Topic
  • 5 replies
  • Latest Post - ‏2012-07-27T05:43:41Z by AvV
SystemAdmin
SystemAdmin
527 Posts

Pinned topic WPG SFTP PostProcessor

‏2012-06-19T23:55:45Z |
I am trying to write a pre-processor and postprocessor for SFTP connector, to rename the files to *.tmp then back to the original name, so that the client does not attempt to read the incomplete file. (Maybe there’s a better approach than this?) I’ve deployed the pre-processor (GATEWAY.PREPROCESS.SFTP ) and successfully got the files renamed to *.tmp but then I realised that WPG won’t let me import SFTP postprocessor (GATEWAY.POSTPROCESS.SFTP )as it’s an invalid type. Is there any other way that I can rename the file back to the original file? Or maybe I need to add a patch to WPG to allow the SFTP postprocessor?
Updated on 2012-07-27T05:43:41Z at 2012-07-27T05:43:41Z by AvV
  • AvV
    AvV
    117 Posts

    Re: WPG SFTP PostProcessor

    ‏2012-06-20T16:12:11Z  
    Hi,

    When customizing destinations, you have two configuration points :

    • Preprocess: after the document is received from Document Managerand before passing it to transport.
    • Postprocess: after document has been sent, response is expected (if appropriate). When response returned, postprocess handling chainexecutes.

    In your preprocess exit you have set a new destination file name; *.tmp. This new filename is then processed by the transport (SFTP).

    Basically, what you are trying to do is gaining control for your client business process logic. Your client should not read the incoming file until it is not modified anymore.

    The WPG FTP receiver has a special attribute for controlling this correct behavior :
    • File Unchanged Interval to indicate the number of seconds the file size must remain unchanged before the Document Manager retrieves the document for processing. This unchanged interval period ensures that a document has completed its transmission (and is not still in transit) when the Document Manager retrieves it. The default value is 3 seconds.
    For your question "Maybe there’s a better approach than this?", the following.
    • You might suggest your client to use a standard document protocol for reliable document exchange. For example, AS2 or ebMS (both based on HTTP).
    • You might open an enhancement request with WPG for adding this *.tmp rename functionality to the SFTP Destination. Please connect with your IBM Representative.
    • You might advice your client to use WPG 6.2.1 as well

    Hope this helps.

    Arjan

    Senior IT-Specialist
    WebSphere B2B (WPG/WDI), WMQ AMS, WMQ FTE
    IBM Software Services for WebSphere
    Software Group, IMT BNL
  • SystemAdmin
    SystemAdmin
    527 Posts

    Re: WPG SFTP PostProcessor

    ‏2012-07-24T01:04:16Z  
    Through IBM PMR, I've got my answer:

    SFTP postprocess handler is supported since WPG 6.2.1.0. Please upgrade your WPG to WPG 6.2.1.0 or above. For further details, please refer to http://www-01.ibm.com/support/docview.wss?uid=swg27009177
  • AvV
    AvV
    117 Posts

    Re: WPG SFTP PostProcessor

    ‏2012-07-24T05:42:31Z  
    Through IBM PMR, I've got my answer:

    SFTP postprocess handler is supported since WPG 6.2.1.0. Please upgrade your WPG to WPG 6.2.1.0 or above. For further details, please refer to http://www-01.ibm.com/support/docview.wss?uid=swg27009177
    Hi,

    You would like to rename the files to *.tmp then back to the original name. The latter is not possible with postprocess handler.

    When customizing destinations, you have two configuration points :

    • Preprocess: after the document is received from Document Managerand before passing it to transport.
    • Postprocess: after document has been sent, response is expected (if appropriate). When response returned, postprocess handling chainexecutes.
    Arjan

    Senior IT-Specialist
    WebSphere B2B (WPG/WDI), WMQ AMS, WMQ FTE
    IBM Software Services for WebSphere
    Software Group, IMT BNL
  • SystemAdmin
    SystemAdmin
    527 Posts

    Re: WPG SFTP PostProcessor

    ‏2012-07-24T05:54:21Z  
    • AvV
    • ‏2012-07-24T05:42:31Z
    Hi,

    You would like to rename the files to *.tmp then back to the original name. The latter is not possible with postprocess handler.

    When customizing destinations, you have two configuration points :

    • Preprocess: after the document is received from Document Managerand before passing it to transport.
    • Postprocess: after document has been sent, response is expected (if appropriate). When response returned, postprocess handling chainexecutes.
    Arjan

    Senior IT-Specialist
    WebSphere B2B (WPG/WDI), WMQ AMS, WMQ FTE
    IBM Software Services for WebSphere
    Software Group, IMT BNL
    "Postprocess: after document has been sent, response is expected (if appropriate). When response returned, postprocess handling chainexecutes."

    So once the document has been sent, I'd receive that the transfer is complete acknowledgement of sort. Then the custom post-process handler would need to open a new SFTP connection to the client server, issue the name change command, then close the connection. Wouldn't this be possible?
  • AvV
    AvV
    117 Posts

    Re: WPG SFTP PostProcessor

    ‏2012-07-27T05:43:41Z  
    "Postprocess: after document has been sent, response is expected (if appropriate). When response returned, postprocess handling chainexecutes."

    So once the document has been sent, I'd receive that the transfer is complete acknowledgement of sort. Then the custom post-process handler would need to open a new SFTP connection to the client server, issue the name change command, then close the connection. Wouldn't this be possible?
    Hi,

    Yes, it would be possible to re-open the SFTP connection in a custom post-process. However, it is not the best option. Alternatively you write your own SFTP destination.

    Also you might look at the FTP/S Scripting destination where you have the command 'mputren' (http://publib.boulder.ibm.com/infocenter/dmndhelp/v6r2mx/topic/com.ibm.wpg.entadv.doc/config/hub/ftpscript_commands.html)

    And from my previous post :
    • You might suggest your client to use a standard document protocol for reliable document exchange. For example, AS2 or ebMS (both based on HTTP).
    • You might open an enhancement request with WPG for adding this *.tmp rename functionality to the SFTP Destination. Please connect with your IBM Representative.
    • You might advice your client to use WPG 6.2.1 as well

    Hope this helps.

    Arjan

    Senior IT-Specialist
    WebSphere B2B (WPG/WDI), WMQ AMS, WMQ FTE
    IBM Software Services for WebSphere
    Software Group, IMT BNL