【问题标题】:Spring Integration Outbound AdapterSpring 集成出站适配器
【发布时间】:2021-09-10 18:42:16
【问题描述】:

有人可以帮助我提供一个很好的链接来使用 Spring Integration Outbound Adapter 执行以下操作吗?

#1 - Write an API, when user hits the API where csv is input for the API - process via spring 
     integration and send it FTP server (OR)
#2 - Write an API, when user hits the API - fetch the new daily records from DB - write it to 
     a csv file and send it to the FTP server via Spring Integration Outbound Adapter

谢谢

【问题讨论】:

    标签: spring-integration


    【解决方案1】:

    FTP 出站通道适配器在文档中进行了说明:https://docs.spring.io/spring-integration/docs/current/reference/html/ftp.html#ftp-outbound

    您提到的 API 是一个典型的@MessagingGateway,用于接受一些数据,这些数据将成为发送到请求通道的消息的有效负载。文档在这里:https://docs.spring.io/spring-integration/docs/current/reference/html/messaging-endpoints.html#gateway

    要从数据库中获取数据,您可能可以使用 JDBC 出站网关:https://docs.spring.io/spring-integration/docs/current/reference/html/jdbc.html#jdbc-outbound-gateway

    您可能不需要中间本地文件,因为 FileTransferringMessageHandler 可以处理 Stringbyte[]InputStream 有效负载,以便能够将其传输到 FTP。

    查看一些现有示例以获得可能的灵感:https://github.com/spring-projects/spring-integration-samples

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-03-21
      • 2015-07-11
      • 2023-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多