IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  How to correctly use the 'reuseSession' parameter when logging in with SFTP

    Posted Wed May 15, 2024 03:05 AM

    Product:webMethods
    Components:Intergration server
    Version: 10.7
    fix: IS_10.7_Core_Fix5

    I am using pub.client.sftp:login and noticed there’s an optional parameter reuseSession . When set to true, all connections will reuse the already opened session. However, I have a question: if I call pub.client.sftp:login with reuseSession set to true within a flowservice, and then call pub.client.sftp:logout before the flowservice ends, what will happen? Do I need to call pub.client.sftp:logout to log out of SFTP after using the SFTP connection with reuseSession set to true?


    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: How to correctly use the 'reuseSession' parameter when logging in with SFTP

    Posted Wed May 15, 2024 01:57 PM

    Try to provide a screen shot of your flow service , how you want to sequence sftp login and logout.


    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: How to correctly use the 'reuseSession' parameter when logging in with SFTP

    Posted Wed May 15, 2024 09:48 PM

    Thank you for your response.

    In the flowservice shown in the picture, its function is to send multiple images to SFTP, and this flowservice might be called concurrently. I hope to keep the session open after uploading the images, because it involves concurrent calls.
    
    If I set the parameter reuseSession to true, does it mean that I don’t need to perform the logout operation? Because I have tested the following:
    
    When I set the parameter reuseSession to true and do not perform the logout operation, the sessionKey obtained in the next run is the same as the previous one.
    If I call the logout service, the sessionKey obtained in the next run changes.
    
    Summary: What I want is, when calling this flowservice concurrently, to avoid frequent logins and logouts, as frequent logins and logouts seem to significantly impact performance.


    #webMethods
    #Integration-Server-and-ESB


  • 4.  RE: How to correctly use the 'reuseSession' parameter when logging in with SFTP

    Posted Thu May 16, 2024 10:21 AM

    In general, it’s better to logout after every sftp login.

    For your requirement I think below options will work

    Option 1) Ask Source System/API/user to consolidate all his requests and send as one request to webMethods. Loop your sftp put on consolidated request payload.
    2) Change your design such that wm service connects source system every 10 or 15 mins and gets all requests and send to target system in a single sftp login/logout.
    3) Your webMethods service consolidate concurrent calls from source system/API into a consolidated request payload file/db table and perform SFTP put operation for every 10/15 mins.
    4) Increase number concurrent sessions of sftp user in /etc/ssh/sshd_config.


    #webMethods
    #Integration-Server-and-ESB


  • 5.  RE: How to correctly use the 'reuseSession' parameter when logging in with SFTP

    Posted Fri May 17, 2024 04:40 AM

    Thank you for your suggestion. I will try these solutions.

    Have a good day!


    #webMethods
    #Integration-Server-and-ESB


  • 6.  RE: How to correctly use the 'reuseSession' parameter when logging in with SFTP

    Posted Mon May 27, 2024 03:33 AM

    In an SFTP client, the same session can only execute one command at a time. Therefore, it is not recommended to use the reusesession parameter in concurrent scenarios, as it may result in numerous errors.


    #webMethods
    #Integration-Server-and-ESB


  • 7.  RE: How to correctly use the 'reuseSession' parameter when logging in with SFTP

    Posted Mon May 27, 2024 05:09 AM

    Hi,

    please refer to the IS Built-In-Services Reference for your wM version for documentation of this service.

    pub.client.sftp:login
    WmPublic. Connects to a remote SFTP server and logs in with the specified SFTP user
    alias.

    Important: You must use this service to initiate an SFTP session before using most other
    pub.client.sftp services.

    Input Parameters

    • userAlias String Alias containing the SFTP client configuration for an SFTP
      user account. Integration Server creates a new session each time
      it logs on to the SFTP server and returns the session key to the
      user.
    • reuseSession String Flag indicating whether or not Integration Server reuses a
      session that is already open for the specified user alias. Set to:
      – true to reuse the session that is already open for the specified
      user alias. If no session is open for this user alias, the
      pub.client.sftp:login service will create a new session and return the
      key for this new session.
      – false to create a new session for the specified user alias. This is
      the default.

    Output Parameters

    • sessionKey String Unique key for the current SFTP session. Most other
      pub.client.sftp services require this session key to execute.
    • returnCode String Standard SFTP protocol return code.
    • returnMsg String Text message describing the return code.

    Usage Notes
    You cannot execute SFTP commands in parallel using the same session key.

    Regards,
    Holger


    #Integration-Server-and-ESB
    #webMethods