简体   繁体   中英

Apache Active MQ & FTP upload

We have a ActiveMQ setup with camel route. Here is the scenario we are trying to address:

Let's assume we have a route which has some actions which involve multiple Queues and then ends up in a final Queue where the FTP connect happens and we upload it to the FTP location.

In the above scenario how can we configure the route in such a way that we can do a FTP upload of multiple message at the same time that are passing through the route in different threads? We would like multiple FTP upload connection to happen at the same time.

Any kind of help is appreciated in advance.

AFAIK one FTP connection should be able to take care of a route. Just ensure you keep disconnect=false in your ftp connection so that files are transferred over same connection and re-connection overhead is prevented. Still if you wish to create a further parallel process, just write routes like

// your source route
from(yourinput).loadBalance().roundRobin().to("direct:a").to("direct:b").to("direct:c");
    // your ftp routes
    from(direct:a).to(ftp://yourendpoint);
    from(direct:b).to(ftp://yourendpoint);
    from(direct:b).to(ftp://yourendpoint);

That way you can have multiple FTP clients connected to your FTP server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM