camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Graham Little <>
Subject RE: Dynamically configuring FTP component from Exchange input msg?
Date Fri, 24 Aug 2012 21:37:40 GMT
Hi Charles, 

Yes this is possible, you can get the value from either the header or the body content as
you prefer and then you can use the recipientlist to create the dynamic endpoint. You could
use something a little like this:

Processor ftpProcesor = new Processor () {
public void process(Exchange exchange) throws Exception {
Message in = exchange.getIn();

String username = in.getHeader("FTP_USR_NM", String.class);
String password = in.getHeader("FTP_PASSWORD", String.class);

ftpEndpointURL = "ftp://" + username + ""+password;


You could also pass all of the username/password values in at once in a comma separated list,
or xml file or some other format and then loop through each pair and then perform the FTP
operations as you go.

Hope this helps.



> Date: Fri, 24 Aug 2012 08:29:10 -0700
> From:
> Subject: Dynamically configuring FTP component from Exchange input msg?
> To:
> I have a requirement to perform FTP operations on behalf of 100's of parties, all of
which have their own FTP credentials.  Obviously, it would not be practical to configure 100's
of instances of the FTP component with different user's login/password hardcoded in the URI.
 I am wondering if there's a way for the FTP component to pull the user/password from the
message payload or headers?
> Thanks
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message