spring-integration - Spring 集成出站适配器
问题描述
有人可以使用 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
谢谢
解决方案
FTP 出站通道适配器在文档中进行了说明:https ://docs.spring.io/spring-integration/docs/current/reference/html/ftp.html#ftp-outbound 。
您提到的 API 是一个典型@MessagingGateway
的接受一些数据的 API,这些数据将成为发送到请求通道的消息的有效负载。文档在这里: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
可以处理String
,byte[]
或者InputStream
有效负载能够将其传输到 FTP。
查看一些现有示例以获得可能的灵感:https ://github.com/spring-projects/spring-integration-samples 。
推荐阅读
- html - 在代码中插入多个直接图像链接
- python - Tensorflow docker image 无法导入 tensorflow 库,但相同的设置适用于裸机?
- python-3.x - 使用 Selenium 将歌曲添加到 Spotify 播放列表的 Python 代码
- asp.net - Asp.Net Upload Imagem cloudinary
- php - package:discovery 找不到我的 ServiceProvider
- python - Python - 一次循环 N 条记录,然后重新开始
- django - 我是否在 django 中以错误的方式覆盖了模型上的保存方法?
- java - 程序编译但在 Mac 上不显示 GUI
- mongodb - 使用 List 或 Map 时,Flutter 不断传递一个引用,但我需要一个副本
- android - 关于为我的应用设置数据库的一般问题