是否可以使用 Apache Camel 从 HTTPS 路由到 SFTP?
Is it possible to route from HTTPS to SFTP with Apache Camel?
我想从 HTTPS 服务器下载 CSV 文件并将其发送到 SFTP 服务器,我正在为 HTTPS 使用 HTTP4 componenet。是否可以合并两条路线?
{
from("https4:www.00000/00/downloads/sdn.csv?")
.to("sftp://0000000/myhome/?fileName=${file:name}&\");
}
您需要从计时器或其他 "trigger" 开始,以便 "get" 来自 http 站点的文件。默认情况下,'from uri="http.."' 告诉 Camel 在 http 端口上 listen。此外,轮询消费者可能会有所帮助。
参考:http://camel.apache.org/timer.html
参考:http://camel.apache.org/polling-consumer.html
伪代码:
from("timer:...")
.setHeader(Exchange.HTTP_METHOD, constant(org.apache.camel.component.http4.HttpMethods.GET))
.to("https4:www....") <-- Note: the return is now the ${body} in Camel
.to("sftp://...")
我想从 HTTPS 服务器下载 CSV 文件并将其发送到 SFTP 服务器,我正在为 HTTPS 使用 HTTP4 componenet。是否可以合并两条路线?
{
from("https4:www.00000/00/downloads/sdn.csv?")
.to("sftp://0000000/myhome/?fileName=${file:name}&\");
}
您需要从计时器或其他 "trigger" 开始,以便 "get" 来自 http 站点的文件。默认情况下,'from uri="http.."' 告诉 Camel 在 http 端口上 listen。此外,轮询消费者可能会有所帮助。
参考:http://camel.apache.org/timer.html
参考:http://camel.apache.org/polling-consumer.html
伪代码:
from("timer:...")
.setHeader(Exchange.HTTP_METHOD, constant(org.apache.camel.component.http4.HttpMethods.GET))
.to("https4:www....") <-- Note: the return is now the ${body} in Camel
.to("sftp://...")