user821863
user821863

Reputation: 479

Sending file using Spring Batch sftp

I'm trying to send a file with sftp using Spring Batch.

I find a great example/tutorial on this site https://blog.codecentric.de/en/2011/09/send-data-secure-with-sftp-and-spring-batch/ which I followed, though I am getting the "Could not send file per SFTP: ..." caught exception in the example in the link above in the SftpTasklet class. I believe my problem is that the int-sftp:outbound-channel-adapter in my application context is never getting called. The id associated with it sftpOutboundAdapter not referenced anywhere else on the page and I do not see how it gets called. I have found similar tutorials on other sites where it is also never explicitly called.

Basically, my question comes down to: how does the spring batch int-sftp:outbound-channel-adapter get called?

Thanks in advance

Upvotes: 1

Views: 4275

Answers (1)

Gary Russell
Gary Russell

Reputation: 174759

The tasklet sends a message (with a File payload) to outputChannel (sftpChannel.send(message);) which, in turn sends it to the outbound adapter.

Turn on DEBUG logging for org.springframework.integration to see the messasge flow.

Upvotes: 3

Related Questions