Announcement Announcement Module
Collapse
No announcement yet.
SFTP inbound adapter not working Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SFTP inbound adapter not working

    hi,
    I am using SFTP inbound adapter for a POC. After doing the setup and running the client, i am able to establish the connection with the SFTP site. But when i place files on the SFTP site no message is delivered to the client.
    calling receive(500) on channel always returns null.

    xml config is like:

    <bean id="sftpClientFactory"
    class="org.springframework.integration.sftp.sessio n.DefaultSftpSessionFactory">
    <property name="host" value="xxx" />
    <property name="port" value="xxx" />
    <property name="user" value="xxx" />
    <property name="password" value="xxxx" />
    </bean>

    <int-sftp:inbound-channel-adapter id="sftpInbound"
    channel="sftpChannel" session-factory="sftpClientFactory" charset="UTF-8"
    auto-create-local-directory="true" delete-remote-files="true"
    filename-pattern="*" remote-directory="ABSOLUTE PATH to remote dir"
    remote-file-separator="/" local-filename-generator-expression="#this.toUpperCase() + '.a'"
    local-directory="Absolute path to local dir">
    <intoller fixed-rate="500" />
    </int-sftp:inbound-channel-adapter>

    <int:channel id="sftpChannel">
    <int:queue />
    </int:channel>

    Client is written like below:

    ApplicationContext context = new ClassPathXmlApplicationContext("classpath*:**/spring*.xml");
    PollableChannel sftpChannel = context.getBean("sftpChannel", PollableChannel.class);
    for (int i = 0; i < 100; i++) {
    System.out.println("Received file message: " + sftpChannel.receive(500));
    }

    i am using spring 3.1.0 and integration 2.1.3
    Any pointers to debug will be helpful.

  • #2
    Have you tried the samples: https://github.com/SpringSource/spri...ster/basic/ftp and https://github.com/SpringSource/spri...ter/basic/sftp

    Don't take it the wrong way, all I am trying to do is establish some base. For example I know samples work in several environments we've tested, so if you can't get it to work on yours then may be we need to know more about specifics of your environment.

    Let us know

    Comment


    • #3
      hi Oleg,
      Thanks for responding.
      Yes, I had tried the sample shared at https://github.com/SpringSource/spri...ter/basic/sftp.
      Same problems exists with the downloaded sample as well.

      Specifics of the my set up are as below:
      1. client is on windows 7
      2. SFTP site is on LAN on RHEL 6.0
      3. using SSH-2.0-mod_sftp/0.9.8
      4. log file is attached
      5. changes done to sample
      a. using username and password to establish connection instead of private key and passphrase
      b. using filename-regex=".*\.*$" instead of filename-regex=".*\.txt$"
      6. using following libraries
      commons-logging-1.1
      junit-4.10
      org.springframework.aop-3.0.7.RELEASE
      org.springframework.asm-3.0.7.RELEASE
      org.springframework.beans-3.0.7.RELEASE
      org.springframework.context-3.0.7.RELEASE
      org.springframework.core-3.0.7.RELEASE
      org.springframework.expression-3.0.7.RELEASE
      org.springframework.test-3.0.7.RELEASE
      spring-integration-core-2.0.6.RELEASE
      spring-integration-file-2.0.6.RELEASE
      spring-integration-sftp-2.0.6.RELEASE
      aopalliance-1.0
      jsch-0.1.38

      Comment


      • #4
        I'd suggest to upgrade to the latest release of SI which is 2.1.3. There was some work done on SFTP adapters and 2.0.6 is a very old release, but I'll look anyway

        Comment


        • #5
          Hi Oleg,
          I tried with the following libraries. Same issue exists.
          commons-logging-1.1
          junit-4.10
          org.springframework.aop-3.1.0.RELEASE
          org.springframework.asm-3.1.0.RELEASE
          org.springframework.beans-3.1.0.RELEASE
          org.springframework.context-3.1.0.RELEASE
          org.springframework.core-3.1.0.RELEASE
          org.springframework.expression-3.1.0.RELEASE
          org.springframework.test-3.1.0.RELEASE
          spring-integration-core-2.1.3.RELEASE
          spring-integration-file-2.1.3.RELEASE
          spring-integration-sftp-2.1.3.RELEASE
          aopalliance-1.0
          jsch-0.1.38

          I am also attaching the files used and the log generated.
          On the sftp site i have 'input' folder under base directory '/'.
          Under 'int-sftp:inbound-channel-adapter' tag, I have given 'remote-directory' values as 'input/'.
          Am i doing this right.

          Please have a look and let me know.

          Thanks for showing the light.

          Comment

          Working...
          X