user3317519 user3317519 - 1 year ago 80
Java Question

Is it possible to route from HTTPS to SFTP with Apache Camel?

I want to download a CSV file from HTTPS server and send it to SFTP server and I'm using HTTP4 componenet for HTTPS. Is it possible to combine two routes?


Answer Source

You need to start with a timer or other "trigger" in order to "get" the file from an http site. By default, 'from uri="http.."' tells Camel to listen on an http port. Also, a Polling Consumer may be helpful.



Pseudo code:

.setHeader(Exchange.HTTP_METHOD, constant(org.apache.camel.component.http4.HttpMethods.GET))
.to("https4:www....")  <-- Note: the return is now the ${body} in Camel
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download