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.


#TechXchangePresenter
 View Only
  • 1.  SFTP service hang issue

    Posted Fri April 26, 2013 10:42 AM

    Hi,

    We are facing some issues due to SFTP service hang . We have some services which calls custom java service for sftp login … So sometimes if login serivce gets hang then its parent flow service also gets hang. We have to manually kill the services everytime. There are multiple services which are using same java service for sftp login and all these gets hang. as all are trying to connect to same server. Checked with client but they are saying there is no issue at their end and other users are not facing any issue.It is happening atleast once in a week. To avoid this i added timeout in channel.connect and session.connect method for timeput in java serivce but it didnt work and problem remained same.

    Parent flow service
    —>sftpLogIn (java service) (i have set timeout for this service’s property also and inside the java code set timeout also)
    ---->sftp:cd

    Java service

    // pipeline
    IDataCursor pipelineCursor = pipeline.getCursor();
    String ftpHost = IDataUtil.getString( pipelineCursor, "ftpHost" );
    int ftpPort = Integer.parseInt(IDataUtil.getString( pipelineCursor, "ftpPort" ));
    String ftpUserName = IDataUtil.getString( pipelineCursor, "ftpUserName" );
    String ftpPassword = IDataUtil.getString( pipelineCursor, "ftpPassword" );
    pipelineCursor.destroy();

    String status = null;

    //First Create a JSch session
    System.out.println("Creating session.");
    JSch jsch = new JSch();
    Session session = null;
    Channel channel = null;
    ChannelSftp c = null;
    
    //
    try {
    //Create a session sending through our username and password
    
    
    session = jsch.getSession(ftpUserName, ftpHost, ftpPort);    
    session.setPassword(ftpPassword);
    //Security.addProvider(new com.sun.crypto.provider.SunJCE());
    
    //Setup Strict HostKeyChecking to no so we dont get the 
    //unknown host key exception
    //
    Properties config = new Properties();
    config.put("StrictHostKeyChecking", "no");
    
    
    session.setConfig(config);
    
    
    //session.connect();
    session.connect(60000);
    
    
    //
    //Open the SFTP channel
    //
    channel = session.openChannel("sftp");
    //	channel.connect();
    channel.connect(60000);
    c = (ChannelSftp)channel;
    status = "OK";
    }
    catch (Exception e) {
    status = "Unable to connect to FTP server. "+e.toString();
    }
    

    // pipeline
    IDataCursor pipelineCursor_1 = pipeline.getCursor();
    IDataUtil.put( pipelineCursor_1, "ChannelSftp", c );
    IDataUtil.put( pipelineCursor_1, "SessionFactory", session );
    IDataUtil.put(pipelineCursor_1, "status", status);

    pipelineCursor.destroy();

    Can anyone please tell how can i set some timeout so that parent service doesnt get hang.Even i tried to set timeout in parent service for java service as 120 seconds but that also didnt work.


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 2.  RE: SFTP service hang issue

    Posted Fri April 26, 2013 01:14 PM

    try to use:
    session.connect();
    session.setTimeout(Integer.parseInt(timeout));
    in your code


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB


  • 3.  RE: SFTP service hang issue

    Posted Mon April 29, 2013 12:13 PM

    Hi,

    session.connect();
    session.setTimeout(60000);

    and

    session.connect(60000); is same thing. both didnt work for me. Is there any other option. Kindly suggest.


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods


  • 4.  RE: SFTP service hang issue

    Posted Thu May 02, 2013 04:20 PM


  • 5.  RE: SFTP service hang issue

    Posted Tue May 21, 2013 05:55 AM

    Hi Prerna,
    Which webMethods version are you using? As per my knowledge service timeout does not work properly in version 8 and older versions. From version 8.2 it works properly.

    Regards,
    Vikas


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 6.  RE: SFTP service hang issue

    Posted Tue May 21, 2013 12:13 PM

    Do you have any FTP connection timeout global settings in the Extended Setting on the IS?

    What is your IS version? Did you try use OpenSSH for SFTP implementation?

    HTH,
    RMG


    #Flow-and-Java-services
    #Integration-Server-and-ESB
    #webMethods


  • 7.  RE: SFTP service hang issue

    Posted Mon February 05, 2018 01:15 AM

    Hi All

    Iam facing the similar issue, could someone please share the resolution/fix for this jsch login hanging issue.
    In my case, after sending 20files(in sequence) login thread started hanging for 21st file forever.


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 8.  RE: SFTP service hang issue

    Posted Mon February 05, 2018 07:24 AM

    Hi,

    can you please provide some more details please?

    Are you using built-in sftp feature (available since 9.5)?
    Which exact wM version are you on? Any Fixes applied?

    Please provide an outline of your service (where do you place the loop over the files?):
    login
    put
    logout

    Regards,
    Holger


    #Integration-Server-and-ESB
    #Flow-and-Java-services
    #webMethods