title: How to download files from remote server using spring integration sftp outbound gateway?
body: <p>I have spring batch setup (remote partitioning), which reads items from files and process them. </p>
  
  <p>If input file do not exist, I want to copy them from remote server. So I have added a step listener in that I am trying to download files from remote server using spring integration sftp outbound gateway.</p>
  
  <pre><code>public class PrepareExchangeListListener implements StepExecutionListener {
  
      private String localDir;
      private String remoteDir;
  
      private DirectChannel requestChannel;
      private PollableChannel replyChannel;
  
      public String getLocalDir() {
          return localDir;
      }
  
      public void setLocalDir(String localDir) {
          this.localDir = localDir;
      }
  
      public String getRemoteDir() {
          return remoteDir;
      }
  
      public void setRemoteDir(String remoteDir) {
          this.remoteDir = remoteDir;
      }
  
      public DirectChannel getRequestChannel() {
          return requestChannel;
      }
  
      public void setRequestChannel(DirectChannel requestChannel) {
          this.requestChannel = requestChannel;
      }
  
      public PollableChannel getReplyChannel() {
          return replyChannel;
      }
  
      public void setReplyChannel(PollableChannel replyChannel) {
          this.replyChannel = replyChannel;
      }
  
      @Override
      public void beforeStep(StepExecution stepExecution) {
          // TODO Auto-generated method stub
  
          System.out.println("Listener triggered.");
  
          this.requestChannel.send(new GenericMessage&lt;Object&gt;(this.remoteDir
                  + "/" + "*"));
  
          Message&lt;?&gt; result = this.replyChannel.receive(100000);
  
          List&lt;File&gt; localFiles = (List&lt;File&gt;) result.getPayload();
  
          for (File file : localFiles) {
  
              System.out.println(file.getName());
  
          }
  
      }
  
      @Override
      public ExitStatus afterStep(StepExecution stepExecution) {
  
          return null;
      }
  
  }
  </code></pre>
  
  <p>I am referring to this test case</p>
  
  <p><a href="https://github.com/spring-projects/spring-integration/blob/master/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpOutboundTests.java" rel="nofollow">https://github.com/spring-projects/spring-integration/blob/master/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpOutboundTests.java</a></p>
  
  <p><a href="https://github.com/spring-projects/spring-integration/blob/master/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpServerOutboundTests-context.xml" rel="nofollow">https://github.com/spring-projects/spring-integration/blob/master/spring-integration-sftp/src/test/java/org/springframework/integration/sftp/outbound/SftpServerOutboundTests-context.xml</a></p>
  
  <p>Below is my configuration,</p>
  
  <pre><code>&lt;rabbit:template id="importExchangesAmqpTemplate"
      connection-factory="rabbitConnectionFactory" routing-key="importExchangesQueue"
      reply-timeout="${import.exchanges.partition.timeout}"&gt;
  &lt;/rabbit:template&gt;
  
  &lt;int:channel id="importExchangesOutboundChannel"&gt;
      &lt;int:dispatcher task-executor="taskExecutor" /&gt;
  &lt;/int:channel&gt;
  
  &lt;int:channel id="importExchangesInboundStagingChannel" /&gt;
  
  &lt;amqp:outbound-gateway request-channel="importExchangesOutboundChannel"
      reply-channel="importExchangesInboundStagingChannel" amqp-template="importExchangesAmqpTemplate"
      mapped-request-headers="correlationId, sequenceNumber, sequenceSize, STANDARD_REQUEST_HEADERS"
      mapped-reply-headers="correlationId, sequenceNumber, sequenceSize, STANDARD_REQUEST_HEADERS" /&gt;
  
  
  &lt;beans:bean id="importExchangesMessagingTemplate"
      class="org.springframework.integration.core.MessagingTemplate"
      p:defaultChannel-ref="importExchangesOutboundChannel"
      p:receiveTimeout="${import.exchanges.partition.timeout}" /&gt;
  
  
  &lt;beans:bean id="importExchangesPartitionHandler"
      class="org.springframework.batch.integration.partition.MessageChannelPartitionHandler"
      p:stepName="importExchangesStep" p:gridSize="${import.exchanges.grid.size}"
      p:messagingOperations-ref="importExchangesMessagingTemplate" /&gt;
  
  &lt;int:aggregator ref="importExchangesPartitionHandler"
      send-partial-result-on-expiry="true" send-timeout="${import.exchanges.step.timeout}"
      input-channel="importExchangesInboundStagingChannel" /&gt;
  
  &lt;amqp:inbound-gateway concurrent-consumers="${import.exchanges.consumer.concurrency}"
      request-channel="importExchangesInboundChannel" reply-channel="importExchangesOutboundStagingChannel"
      queue-names="importExchangesQueue" connection-factory="rabbitConnectionFactory"
      mapped-request-headers="correlationId, sequenceNumber, sequenceSize, STANDARD_REQUEST_HEADERS"
      mapped-reply-headers="correlationId, sequenceNumber, sequenceSize, STANDARD_REQUEST_HEADERS" /&gt;
  
  
  &lt;int:channel id="importExchangesInboundChannel" /&gt;
  
  &lt;int:service-activator ref="stepExecutionRequestHandler"
      input-channel="importExchangesInboundChannel" output-channel="importExchangesOutboundStagingChannel" /&gt;
  
  &lt;int:channel id="importExchangesOutboundStagingChannel" /&gt;
  
  
  &lt;beans:bean id="importExchangesItemWriter"
      class="com.st.batch.foundation.writers.ImportExchangesAndEclsItemWriter"
      p:symfony-ref="symfonyStepScoped" p:timeout="${import.exchanges.item.timeout}"
      scope="step" /&gt;
  
  &lt;beans:bean id="importExchangesPartitioner"
      class="org.springframework.batch.core.partition.support.MultiResourcePartitioner"
      p:resources="file:${spring.tmp.batch.dir}/#{jobParameters[batch_id]}/exchanges/exchanges_*.txt"
      scope="step" /&gt;
  
  &lt;beans:bean id="importExchangesFileItemReader"
      class="org.springframework.batch.item.file.FlatFileItemReader"
      p:resource="#{stepExecutionContext[fileName]}" p:lineMapper-ref="stLineMapper"
      scope="step" /&gt;
  
  
  
  
  &lt;beans:bean id="prepareExchangeListListener"
      class="com.st.batch.listeners.PrepareExchangeListListener"
      p:requestChannel-ref="inboundMGetRecursiveFiltered" p:localDir="/tmp/spring/batch"
      p:replyChannel-ref="outputSftp" p:remoteDir="/tmp/spring/batch" /&gt;
  
  &lt;beans:bean id="ftpSessionFactory"
      class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory"&gt;
      &lt;beans:property name="host" value="myRemoteServer" /&gt;
      &lt;beans:property name="user" value="username" /&gt;
      &lt;beans:property name="password" value="password" /&gt;
  &lt;/beans:bean&gt;
  
  &lt;int:channel id="outputSftp"&gt;
      &lt;int:queue /&gt;
  &lt;/int:channel&gt;
  
  
  &lt;int:channel id="inboundMGetRecursiveFiltered" /&gt;
  
  &lt;int-sftp:outbound-gateway session-factory="ftpSessionFactory"
      request-channel="inboundMGetRecursiveFiltered" command="mget"
      expression="payload" command-options="-R" local-directory="/tmp/spring/batch"
      reply-channel="outputSftp" /&gt;
  
  
  &lt;step id="importExchangesStep"&gt;
      &lt;tasklet transaction-manager="transactionManager"&gt;
          &lt;chunk reader="importExchangesFileItemReader" writer="importExchangesItemWriter"
              commit-interval="${import.exchanges.commit.interval}" /&gt;
      &lt;listeners&gt;
          &lt;listener ref="prepareExchangeListListener" /&gt;
      &lt;/listeners&gt;
  
  
      &lt;/tasklet&gt;
  
  &lt;/step&gt;
  
  &lt;job id="importExchangesJob" restartable="true"&gt;
      &lt;step id="importExchangesStep.master"&gt;
          &lt;partition partitioner="importExchangesPartitioner"
              handler="importExchangesPartitionHandler" /&gt;
  
      &lt;listeners&gt;
          &lt;listener ref="prepareExchangeListListener" /&gt;
      &lt;/listeners&gt;
      &lt;/step&gt;
  &lt;/job&gt;
  </code></pre>
  
  <p>Am I doing anything wrong as nothing seems to be working. </p>
  
  <p>Also, can int-sftp:outbound-gateway have scope="step" ? If I try to add, it gives error in STS.</p>
  
  <p>Log</p>
  
  <p>Here is a log with DEBUG level enabled</p>
  
  <pre><code>19:42:18,329  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Connecting to SERVER_IP port 22
  19:42:18,473  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Connection established
  19:42:18,623  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Remote version string: SSH-2.0-OpenSSH_5.8p1 Debian-7ubuntu1
  19:42:18,623  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Local version string: SSH-2.0-JSCH-0.1.45
  19:42:18,624  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
  19:42:18,668  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - aes256-ctr is not available.
  19:42:18,668  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - aes192-ctr is not available.
  19:42:18,668  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - aes256-cbc is not available.
  19:42:18,669  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - aes192-cbc is not available.
  19:42:18,669  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - arcfour256 is not available.
  19:42:18,669  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - CheckKexes: diffie-hellman-group14-sha1
  19:42:18,673  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - diffie-hellman-group14-sha1 is not available.
  19:42:18,673  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_KEXINIT sent
  19:42:18,767  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_KEXINIT received
  19:42:18,767  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - kex: server-&gt;client aes128-ctr hmac-md5 none
  19:42:18,767  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - kex: client-&gt;server aes128-ctr hmac-md5 none
  19:42:18,778  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_KEXDH_INIT sent
  19:42:18,778  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - expecting SSH_MSG_KEXDH_REPLY
  19:42:18,935  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - ssh_rsa_verify: signature true
  19:42:18,938  WARN jobLauncherTaskExecutor-1 jcraft.jsch:55 - Permanently added 'SERVER_IP' (RSA) to the list of known hosts.
  19:42:18,939  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_NEWKEYS sent
  19:42:18,939  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_NEWKEYS received
  19:42:18,945  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_SERVICE_REQUEST sent
  19:42:19,000 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  19:42:19,088  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_SERVICE_ACCEPT received
  19:42:19,918  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Authentications that can continue: publickey,keyboard-interactive,password
  19:42:19,918  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Next authentication method: publickey
  19:42:19,919  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Authentications that can continue: password
  19:42:19,920  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Next authentication method: password
  19:42:20,001 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  19:42:20,084  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Authentication succeeded (password).
  19:42:20,542 DEBUG jobLauncherTaskExecutor-1 util.SimplePool:184 - Obtained new org.springframework.integration.sftp.session.SftpSession@7d4d6823.
  19:42:21,001 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  19:42:21,134 DEBUG jobLauncherTaskExecutor-1 session.CachingSessionFactory:109 - Releasing Session back to the pool.
  19:42:21,134 DEBUG jobLauncherTaskExecutor-1 util.SimplePool:215 - Releasing org.springframework.integration.sftp.session.SftpSession@7d4d6823 back to the pool
  19:42:21,134 DEBUG jobLauncherTaskExecutor-1 gateway.SftpOutboundGateway:197 - handler 'org.springframework.integration.sftp.gateway.SftpOutboundGateway#0' sending reply Message: [Payload=[]][Headers={timestamp=1403532741134, id=e4f6e7b3-b8bf-4364-99b4-ca889e5aa7fa, file_remoteDirectory=/tmp/spring/batch/, file_remoteFile=*}]
  19:42:21,135 DEBUG jobLauncherTaskExecutor-1 channel.QueueChannel:224 - preSend on channel 'outputSftp', message: [Payload=[]][Headers={timestamp=1403532741134, id=e4f6e7b3-b8bf-4364-99b4-ca889e5aa7fa, file_remoteDirectory=/tmp/spring/batch/, file_remoteFile=*}]
  19:42:21,135 DEBUG jobLauncherTaskExecutor-1 channel.QueueChannel:237 - postSend (sent=true) on channel 'outputSftp', message: [Payload=[]][Headers={timestamp=1403532741134, id=e4f6e7b3-b8bf-4364-99b4-ca889e5aa7fa, file_remoteDirectory=/tmp/spring/batch/, file_remoteFile=*}]
  19:42:21,135 DEBUG jobLauncherTaskExecutor-1 channel.DirectChannel:237 - postSend (sent=true) on channel 'inboundMGetRecursiveFiltered', message: [Payload=/tmp/spring/batch/*][Headers={timestamp=1403532738315, id=334c6d05-be25-4a9b-b9d8-773103da1cfd, file_remoteDirectory=/tmp/spring/batch, file_remoteFile=*.txt}]
  19:42:21,135 DEBUG jobLauncherTaskExecutor-1 channel.QueueChannel:258 - postReceive on channel 'outputSftp', message: [Payload=[]][Headers={timestamp=1403532741134, id=e4f6e7b3-b8bf-4364-99b4-ca889e5aa7fa, file_remoteDirectory=/tmp/spring/batch/, file_remoteFile=*}]
  19:42:21,193 DEBUG jobLauncherTaskExecutor-1 scope.StepScope:108 - Creating object in scope=step, name=scopedTarget.importExchangesPartitioner
  19:42:21,193 DEBUG jobLauncherTaskExecutor-1 support.DefaultListableBeanFactory:435 - Creating instance of bean 'scopedTarget.importExchangesPartitioner'
  19:42:21,204 DEBUG jobLauncherTaskExecutor-1 scope.StepScope:136 - Registered destruction callback in scope=step, name=scopedTarget.importExchangesPartitioner
  19:42:21,204 DEBUG jobLauncherTaskExecutor-1 support.DefaultListableBeanFactory:463 - Finished creating instance of bean 'scopedTarget.importExchangesPartitioner'
  19:42:22,000 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  19:42:23,000 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  19:42:24,001 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  19:42:25,000 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  19:42:26,000 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  19:42:27,000 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  </code></pre>
  
  <p>Full log here</p>
  
  <p><a href="http://pastebin.com/4KDBGqCH" rel="nofollow">http://pastebin.com/4KDBGqCH</a></p>
  
  <p>UPDATE:</p>
  
  <p>Below is just a simple test instead of entire use case, </p>
  
  <p>Test job</p>
  
  <pre><code>&lt;beans:bean id="testStepTasklet"
      class="com.sta.batch.foundation.tasklets.TestTasklet"
      p:requestChannel-ref="inboundMGetRecursive" p:replyChannel-ref="output" /&gt;
  
  &lt;job id="testJob"&gt;
      &lt;step id="testStep"&gt;
          &lt;tasklet ref="testStepTasklet" /&gt;
      &lt;/step&gt;
  &lt;/job&gt;
  </code></pre>
  
  <p>sftp oubound gateway configuration</p>
  
  <pre><code>&lt;beans:bean id="sftpSessionFactory"
      class="org.springframework.integration.sftp.session.DefaultSftpSessionFactory"&gt;
      &lt;beans:property name="host" value="MY_SERVER_ID" /&gt;
      &lt;beans:property name="user" value="myUser" /&gt;
      &lt;beans:property name="password" value="myPassword" /&gt;
  &lt;/beans:bean&gt;
  
  
  &lt;int:channel id="output"&gt;
      &lt;int:queue /&gt;
  &lt;/int:channel&gt;
  
  &lt;int:channel id="inboundMGetRecursive" /&gt;
  
  &lt;int-sftp:outbound-gateway session-factory="sftpSessionFactory"
      request-channel="inboundMGetRecursive" command="mget" expression="payload"
      command-options="-R" local-directory="/tmp/spring/batch/"
      reply-channel="output" /&gt;
  </code></pre>
  
  <p>TestTasklet</p>
  
  <pre><code>public class TestTasklet implements Tasklet, InitializingBean {
  
      private DirectChannel requestChannel;
      private PollableChannel replyChannel;
  
      public DirectChannel getRequestChannel() {
          return requestChannel;
      }
  
      public void setRequestChannel(DirectChannel requestChannel) {
          this.requestChannel = requestChannel;
      }
  
      public PollableChannel getReplyChannel() {
          return replyChannel;
      }
  
      public void setReplyChannel(PollableChannel replyChannel) {
          this.replyChannel = replyChannel;
      }
  
      @Override
      public void afterPropertiesSet() throws Exception {
          // TODO Auto-generated method stub
  
      }
  
      @SuppressWarnings("unchecked")
      @Override
      public RepeatStatus execute(StepContribution contribution,
              ChunkContext chunkContext) throws Exception {
  
          String dir = "/tmp/spring/batch/";
          this.requestChannel.send(new GenericMessage&lt;Object&gt;(dir + "*"));
          Message&lt;?&gt; result = this.replyChannel.receive(1000);
  
          List&lt;File&gt; localFiles = (List&lt;File&gt;) result.getPayload();
  
          for (File file : localFiles) {
              System.out.println(file.getName());
          }
  
          return RepeatStatus.FINISHED;
  
      }
  
  }
  </code></pre>
  
  <p>Log:</p>
  
  <pre><code>12:30:50,017 DEBUG jobLauncherTaskExecutor-1 context.StepContextRepeatCallback:76 - Chunk execution starting: queue size=0
  12:30:50,025 DEBUG jobLauncherTaskExecutor-1 channel.DirectChannel:224 - preSend on channel 'inboundMGetRecursive', message: [Payload=/tmp/spring/batch/*][Headers={timestamp=1403593250024, id=7080f48d-6b7d-4d31-b0b8-b3384dc93e53}]
  12:30:50,025 DEBUG jobLauncherTaskExecutor-1 gateway.SftpOutboundGateway:67 - org.springframework.integration.sftp.gateway.SftpOutboundGateway#0 received message: [Payload=/tmp/spring/batch/*][Headers={timestamp=1403593250024, id=7080f48d-6b7d-4d31-b0b8-b3384dc93e53}]
  12:30:50,038  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Connecting to SERVER_IP port 22
  12:30:50,181  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Connection established
  12:30:50,332  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Remote version string: SSH-2.0-OpenSSH_5.8p1 Debian-7ubuntu1
  12:30:50,333  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Local version string: SSH-2.0-JSCH-0.1.45
  12:30:50,333  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - CheckCiphers: aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc,3des-ctr,arcfour,arcfour128,arcfour256
  12:30:50,376  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - aes256-ctr is not available.
  12:30:50,377  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - aes192-ctr is not available.
  12:30:50,377  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - aes256-cbc is not available.
  12:30:50,377  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - aes192-cbc is not available.
  12:30:50,377  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - arcfour256 is not available.
  12:30:50,377  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - CheckKexes: diffie-hellman-group14-sha1
  12:30:50,381  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - diffie-hellman-group14-sha1 is not available.
  12:30:50,382  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_KEXINIT sent
  12:30:50,477  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_KEXINIT received
  12:30:50,477  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - kex: server-&gt;client aes128-ctr hmac-md5 none
  12:30:50,477  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - kex: client-&gt;server aes128-ctr hmac-md5 none
  12:30:50,489  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_KEXDH_INIT sent
  12:30:50,489  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - expecting SSH_MSG_KEXDH_REPLY
  12:30:50,645  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - ssh_rsa_verify: signature true
  12:30:50,647  WARN jobLauncherTaskExecutor-1 jcraft.jsch:55 - Permanently added 'SERVER_IP' (RSA) to the list of known hosts.
  12:30:50,648  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_NEWKEYS sent
  12:30:50,648  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_NEWKEYS received
  12:30:50,651  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_SERVICE_REQUEST sent
  12:30:50,794  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - SSH_MSG_SERVICE_ACCEPT received
  12:30:50,964  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Authentications that can continue: publickey,keyboard-interactive,password
  12:30:50,964  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Next authentication method: publickey
  12:30:50,966  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Authentications that can continue: password
  12:30:50,966  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Next authentication method: password
  12:30:51,001 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  12:30:51,126  INFO jobLauncherTaskExecutor-1 jcraft.jsch:52 - Authentication succeeded (password).
  12:30:51,581 DEBUG jobLauncherTaskExecutor-1 util.SimplePool:184 - Obtained new org.springframework.integration.sftp.session.SftpSession@329c5e61.
  12:30:52,000 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  12:30:52,160 DEBUG jobLauncherTaskExecutor-1 session.CachingSessionFactory:109 - Releasing Session back to the pool.
  12:30:52,160 DEBUG jobLauncherTaskExecutor-1 util.SimplePool:215 - Releasing org.springframework.integration.sftp.session.SftpSession@329c5e61 back to the pool
  12:30:52,161 DEBUG jobLauncherTaskExecutor-1 gateway.SftpOutboundGateway:197 - handler 'org.springframework.integration.sftp.gateway.SftpOutboundGateway#0' sending reply Message: [Payload=[]][Headers={timestamp=1403593252160, id=00899cf1-5dd7-4192-b0ae-9812fe07283e, file_remoteDirectory=/tmp/spring/batch/, file_remoteFile=*}]
  12:30:52,161 DEBUG jobLauncherTaskExecutor-1 channel.QueueChannel:224 - preSend on channel 'output', message: [Payload=[]][Headers={timestamp=1403593252160, id=00899cf1-5dd7-4192-b0ae-9812fe07283e, file_remoteDirectory=/tmp/spring/batch/, file_remoteFile=*}]
  12:30:52,161 DEBUG jobLauncherTaskExecutor-1 channel.QueueChannel:237 - postSend (sent=true) on channel 'output', message: [Payload=[]][Headers={timestamp=1403593252160, id=00899cf1-5dd7-4192-b0ae-9812fe07283e, file_remoteDirectory=/tmp/spring/batch/, file_remoteFile=*}]
  12:30:52,162 DEBUG jobLauncherTaskExecutor-1 channel.DirectChannel:237 - postSend (sent=true) on channel 'inboundMGetRecursive', message: [Payload=/tmp/spring/batch/*][Headers={timestamp=1403593250024, id=7080f48d-6b7d-4d31-b0b8-b3384dc93e53}]
  12:30:52,162 DEBUG jobLauncherTaskExecutor-1 channel.QueueChannel:258 - postReceive on channel 'output', message: [Payload=[]][Headers={timestamp=1403593252160, id=00899cf1-5dd7-4192-b0ae-9812fe07283e, file_remoteDirectory=/tmp/spring/batch/, file_remoteFile=*}]
  12:30:52,162 DEBUG jobLauncherTaskExecutor-1 tasklet.TaskletStep:433 - Applying contribution: [StepContribution: read=0, written=0, filtered=0, readSkips=0, writeSkips=0, processSkips=0, exitStatus=EXECUTING]
  12:30:52,164 DEBUG jobLauncherTaskExecutor-1 tasklet.TaskletStep:447 - Saving step execution before commit: StepExecution: id=371, version=1, name=testStep, status=STARTED, exitStatus=EXECUTING, readCount=0, filterCount=0, writeCount=0 readSkipCount=0, writeSkipCount=0, processSkipCount=0, commitCount=1, rollbackCount=0, exitDescription=
  12:30:52,283 DEBUG jobLauncherTaskExecutor-1 support.RepeatTemplate:437 - Repeat is complete according to policy and result value.
  12:30:52,284 DEBUG jobLauncherTaskExecutor-1 step.AbstractStep:212 - Step execution success: id=371
  12:30:52,383 DEBUG jobLauncherTaskExecutor-1 step.AbstractStep:276 - Step execution complete: StepExecution: id=371, version=3, name=testStep, status=COMPLETED, exitStatus=COMPLETED, readCount=0, filterCount=0, writeCount=0 readSkipCount=0, writeSkipCount=0, processSkipCount=0, commitCount=1, rollbackCount=0
  12:30:52,432 DEBUG jobLauncherTaskExecutor-1 support.SimpleFlow:175 - Completed state=testJob.testStep with status=COMPLETED
  12:30:52,433 DEBUG jobLauncherTaskExecutor-1 support.SimpleFlow:161 - Handling state=testJob.end1
  12:30:52,433 DEBUG jobLauncherTaskExecutor-1 support.SimpleFlow:175 - Completed state=testJob.end1 with status=COMPLETED
  12:30:52,434 DEBUG jobLauncherTaskExecutor-1 job.AbstractJob:305 - Job execution complete: JobExecution: id=91, version=1, startTime=Tue Jun 24 12:30:49 IST 2014, endTime=null, lastUpdated=Tue Jun 24 12:30:49 IST 2014, status=COMPLETED, exitStatus=exitCode=COMPLETED;exitDescription=, job=[JobInstance: id=91, version=0, Job=[testJob]], jobParameters=[{b=6, batch_id=2014-06-14}]
  12:30:52,457  INFO jobLauncherTaskExecutor-1 support.SimpleJobLauncher:136 - Job: [FlowJob: [name=testJob]] completed with the following parameters: [{b=6, batch_id=2014-06-14}] and the following status: [COMPLETED]
  12:30:53,000 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  12:30:54,000 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  12:30:55,000 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  12:30:56,001 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  12:30:57,000 DEBUG task-scheduler-3 endpoint.SourcePollingChannelAdapter:71 - Received no Message during the poll, returning 'false'
  </code></pre>