Spring integration 如何向spring integration ftp网关接口添加自定义方法?

Spring integration 如何向spring integration ftp网关接口添加自定义方法?,spring-integration,spring-integration-sftp,spring-integration-dsl,Spring Integration,Spring Integration Sftp,Spring Integration Dsl,在Spring integration ftp之后,我通过java配置方式将文件发送到ftp服务器: @MessagingGateway public interface MyGateway { @Gateway(requestChannel = "toFtpChannel") void sendToFtp(File file); } 党卫军 在我看来,上面的代码似乎是使用自定义方法“sendtoptp()”将文件发送到目标ftp服务器。我的问题是,如何向MyGatew

在Spring integration ftp之后,我通过java配置方式将文件发送到ftp服务器:

@MessagingGateway
public interface MyGateway {

     @Gateway(requestChannel = "toFtpChannel")
     void sendToFtp(File file);

}
党卫军

在我看来,上面的代码似乎是使用自定义方法“sendtoptp()”将文件发送到目标ftp服务器。我的问题是,如何向MyGateway接口添加其他方法来实现这些操作

ls (list files)
get (retrieve file)
mget (retrieve file(s))
rm (remove file(s))
mv (move/rename file)
put (send file)
mput (send multiple files)

每个FTP网关只能处理一种方法

你需要为每个人申报一份,然后

@MessagingGateway
public interface MyGateway {

     @Gateway(requestChannel = "toFtpGetChannel")
     void sendToFtpGet(...);

     @Gateway(requestChannel = "toFtpPutChannel")
     void sendToFtpPut(...);

    ...

}

是否有办法订阅任何
requestChannel
。如果是,怎么做?根本不清楚你在问什么;而且,在任何情况下,你都不能在对旧答案的评论中提出新问题。问一个新问题,更清楚地说明你想解决什么;如果新问题的答案与此相关,请参考此答案。
@MessagingGateway
public interface MyGateway {

     @Gateway(requestChannel = "toFtpGetChannel")
     void sendToFtpGet(...);

     @Gateway(requestChannel = "toFtpPutChannel")
     void sendToFtpPut(...);

    ...

}